![]() |
Default controller problem with controller in a subfolder - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Default controller problem with controller in a subfolder (/showthread.php?tid=8849) |
Default controller problem with controller in a subfolder - El Forum - 06-03-2008 [eluser]Macros[/eluser] This seems to have been mentioned before, but still seems to be a bug 1.6.2. Basically, if the default controller looks like: Code: $route['default_controller'] = "folder/controller"; Then the class file is loaded... but the class can't be found. CodeIgniter.php: Code: Line 154: include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); Using the route above, then Code: $class = 'folder/controller' Code: Line 173: if ( ! class_exists($class)... This will return false, as the class name being checked is "folder/controller", but the REAL class name is "controller", and it was loaded in the include line. Cameron. Default controller problem with controller in a subfolder - El Forum - 06-03-2008 [eluser]Pascal Kriete[/eluser] Yup, I run into this one everytime a project grows large enough to warrant the use of folders. The fix is quite a simple one. In system/libraries/router.php: Code: // function _set_routing I've had something like this in my MY_Router file for a while now. Default controller problem with controller in a subfolder - El Forum - 07-29-2008 [eluser]Unknown[/eluser] The bug is still present in 1.6.3. Inparo's fix works great - thank you Default controller problem with controller in a subfolder - El Forum - 11-06-2008 [eluser]Vanilla Junior[/eluser] Thank you for the excellent fix. |