Welcome Guest, Not a member yet? Register   Sign In
How do you make a default controller for a different subdirectory?
#1

[eluser]tomdelonge[/eluser]
for example, i have controllers in the /admin/ directory. How do I make a default controller for that? I know it's in the routes.php config file, what do i add?

Thanks.
#2

[eluser]wowdezign[/eluser]
I normally create a controllers/admin folder and then create my controller classes in that folder.
#3

[eluser]Skuja[/eluser]
Code:
$route['admin'] = 'admin/default_controller';
#4

[eluser]tomdelonge[/eluser]
I don't get it...

Say I want the default controller if you go to /admin to be "home". What would that look like?

I thought the left side (the part in the $route array) is what is in the url...
#5

[eluser]Cro_Crx[/eluser]
If "home" is inside the admin directory then:

Code:
$route['admin'] = 'admin/home';

If it's inside the root directory then:

Code:
$route['admin'] = 'home';
#6

[eluser]tomdelonge[/eluser]
There we go... Sorry I needed it spelled out.

I took "default_controller" literally, since in the default config file it uses that.

Thanks everyone.




Theme © iAndrew 2016 - Forum software by © MyBB