How to set default controller for sub-directory in controllers |
[eluser]gunnarflax[/eluser]
Hi! I have a multilevel-directory structure of my controllers directory. The user guide says that this is fully possible, all I have to do is set a default controller for the sub-dir in the config. The thing is that there is only one key called 'default_controller' and I can't find anywhere how the extra default controller should be named. What should I call it? And how do I need to configure my routes? Thanks!
[eluser]brucebat[/eluser]
Would you not put the next parameter of default_controller in the controller you loaded. So that when the first controller is loaded it will then load another?
[eluser]gunnarflax[/eluser]
Don't think so. The default controller functions in the way that if the url doesn't contain any url-segment for the controller it loads the default one. So if my folder structure is like this: Code: -- controllers Code: http://www.example.com/ Code: $config['default_controller'] = 'home'; Code: http://www.example.com/subdir/ Code: http://www.example.com/subdir/admin/
[eluser]intractve[/eluser]
I do this by... In routes.php Code: $route['subdir'] = 'subdir/admin';
[eluser]Caio[/eluser]
[quote author="intractve" date="1309765818"]I do this by... In routes.php Code: $route['subdir'] = 'subdir/admin'; agreed! that always works best. |
Welcome Guest, Not a member yet? Register Sign In |