Welcome Guest, Not a member yet? Register   Sign In
Default controller per sub-folder?
#1

[eluser]Unknown[/eluser]
I've scoured the forums and found lots of info about default routes, Router.php hacks and other such fun. But I'm still having no luck setting a default controller on a sub-folder basis.

I have the following folder structure:

controllers
-- section1
---- controller1
---- controller2
-- section2
---- controller1
---- controller2

I want to set the default controller for the section1 sub-folder to controller1. I want the default controller for section2 to be controller2.

Goal:
index.php/section1 should behave like index.php/section1/controller1
index.php/section2 should behave like index.php/section2/controller2

This seems so simple, but I can't make it work. TIA for your help!
#2

[eluser]sophistry[/eluser]
what happens when you set the default_controller key in the routes.php file to 'controller1'? that should be all you need to do.

you can't have two default controllers controller1 or controller2 take your pick - "there can be only one."
#3

[eluser]Bramme[/eluser]
I've had the same problem. I fixed it with routing...

$route['section1'] = 'section1/controller1';

etc...




Theme © iAndrew 2016 - Forum software by © MyBB