Welcome Guest, Not a member yet? Register   Sign In
I have a subdirectory in my controllers folder - possibly to set default controller?
#3

(07-23-2015, 05:12 PM)sneakyimp Wrote: I have created a subdirectory called 'admin' in my application/controllers directory. I've got some controllers in there yes sir:

Code:
application/controllers/admin/Dashboard.php
application/controllers/admin/Foo.php
application/controllers/admin/Bar.php

I'm wondering if it's possible to define a default controller::method for that subdirectory in case the url does not specify anything beyond http://example.com/admin

For example, how would I route requests for http://example.com/admin to application/controllers/admin/Dashboard.php?

I really hope I don't have to resort to defining a default controller for every subdirectory in my controllers directory via extensive changes to config/routes.php.

Can anyone tell me if this is possible?

You can do something like this:

PHP Code:
$route['admin'] = 'admin/dashboard'
Romanian CodeIgniter Team :: Translations :: Comunity :: Developers
http://www.codeigniter.com.ro
Reply


Messages In This Thread
RE: I have a subdirectory in my controllers folder - possibly to set default controller? - by Dracula - 07-24-2015, 06:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB