CodeIgniter Forums
route dose not work to sub folders - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19)
+--- Thread: route dose not work to sub folders (/showthread.php?tid=61306)

Pages: 1 2


route dose not work to sub folders - Bassam - 04-07-2015

I have Front folder in the controller
and inside it i have Home.php file
in the file have index function

when i make this in the config/route
PHP Code:
$route['default_controller'] = 'Front/Home/index'

it dose not works
and route to files in the sub folders of the controller dose not works , i must put the class in the controller directly to be accessed by routes .

I use codeigniter 3.0 and  This problem was not happened in codeigniter 2.2.0


RE: route dose no work to sub folders - Muzikant - 04-07-2015

Hi. Try it with small letters and without index at the end.

PHP Code:
$route['default_controller'] = 'front/home'

Make sure your "front" directory have no capital letters in your directory structure.

You can also check documentation related to URI routing.


RE: route dose no work to sub folders - Bassam - 04-07-2015

no changes
the problem still
Note that i use codeigniter 3.0
and it work fine on codeigniter 2.2.0


RE: route dose no work to sub folders - Narf - 04-07-2015

The fact that this has ever worked is a bug - it's a controller/method setting, not a directory/file one. This is explained in the upgrade notes.


RE: route dose no work to sub folders - Bassam - 04-07-2015

but it was work fine in the old version !!


RE: route dose no work to sub folders - gadelat - 04-07-2015

Read again what narf said. Yes, it worked in previous version. Yes, it doesn't anymore. This is intended behaviour.


RE: route dose no work to sub folders - Bassam - 04-08-2015

So there is no way to make it class inside sub folder in the controllers


RE: route dose no work to sub folders - Narf - 04-08-2015

You can have as many classes in as many subdirectories (although I wouldn't advise you to do that), but there's no way to make any of them a default controller.


RE: route dose no work to sub folders - Bassam - 04-08-2015

Thank you Narf
I now change some codes in .\system\core\Router.php , to make it read sub folders, it work fine with me, I will try it for more time To make sure there are no errors in what I change , if i dont found any problems in my codes i will thread my codes
thank you again


RE: route dose no work to sub folders - Narf - 04-08-2015

Please don't ... you shouldn't be modifying those files yourself and the last thing that you should do is encourage others to do so.