Welcome Guest, Not a member yet? Register   Sign In
route dose not work to sub folders
#1
Photo 
(This post was last modified: 04-09-2015, 09:30 AM by Bassam.)

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
Reply
#2

(This post was last modified: 04-07-2015, 11:33 AM by Muzikant.)

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.
Reply
#3

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

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.
Reply
#5

but it was work fine in the old version !!
Reply
#6

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

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

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.
Reply
#9

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
Reply
#10

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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB