Router - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Router (/showthread.php?tid=66212) Pages:
1
2
|
Router - Ljubin - 09-21-2016 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? RE: Router - cartalot - 09-21-2016 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' ){ RE: Router - InsiteFX - 09-21-2016 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. RE: Router - Ljubin - 09-21-2016 (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 RE: Router - Ljubin - 09-21-2016 (09-21-2016, 11:40 AM)InsiteFX Wrote: It's about my case?) RE: Router - cartalot - 09-21-2016 (09-21-2016, 11:40 AM)InsiteFX Wrote: Note: You can NOT use a directory as a part of this setting! Which is definitely true, but in this case the controller is not in a directory. RE: Router - wolfgang1983 - 09-21-2016 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-default_controller_route_with_sub_folder controllers / pages / Welcome.php Code: $route['default_controller'] = 'pages/welcome'; PHP Code: <?php RE: Router - Ljubin - 09-23-2016 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. RE: Router - InsiteFX - 09-23-2016 Use MySQLi RE: Router - wolfgang1983 - 09-23-2016 (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/database/results.html#result-arrays |