Router |
Hello everybody.
I want to replace CI 2.1 to CI 3.1 But i have a problem. I can't transfer to the function an argument from router. Router: PHP Code: $route['default_controller'] = 'pages/show/ukr'; "ukr" - i can't transfer to the function in the class.!? Class: PHP Code: class Pages extends CI_Controller{ This is as it should be?
disclaimer - i'm just writing this out and did not test this so i could be wrong -
but i think you could just give page id a default value PHP Code: $route['default_controller'] = 'pages/show'; PHP Code: public function show($page_id = 'ukr' ){ PHP Code: $route['default_controller'] = 'welcome'; Note: You can NOT use a directory as a part of this setting! CodeIgniter Users Guide - URI Routing Use a Landing Page. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(09-21-2016, 11:15 AM)cartalot Wrote: disclaimer - i'm just writing this out and did not test this so i could be wrong - Yes i could... It just worked in CI 2.1 but does not working in CI 3.1 (09-21-2016, 11:40 AM)InsiteFX Wrote: It's about my case?)
If you need to use subfolder in CI3 for default_controller you need to have a Custom MY_Router.php
core/MY_Router.php Link https://github.com/wolfgang1983/CI3-defa...sub_folder controllers / pages / Welcome.php Code: $route['default_controller'] = 'pages/welcome'; PHP Code: <?php
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
Thanks guys for halp, but i will stay at CI 2.1
There one more error. Don't work this SQL request in CI 3.1.!? PHP Code: $sql = "select * from (select * from net_euro where begin_ip<=$int order by begin_ip desc limit 1) as t where end_ip>=$int"; Perhaps this is not the end.
Use MySQLi
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(09-23-2016, 01:35 PM)Ljubin Wrote: Thanks guys for halp, but i will stay at CI 2.1 This may help $query = $this->db->query("YOUR QUERY"); http://www.codeigniter.com/user_guide/da...ult-arrays
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
|
Welcome Guest, Not a member yet? Register Sign In |