Welcome Guest, Not a member yet? Register   Sign In
SubFolder | Route | Controller
#1

[eluser]al3xandre[/eluser]
Hi all,

That's my first message here ! I recently discovered CI and I decided to try it for a php CMS project

I want to put all the code of my backend in a "admin" folder. I checked the Controller Doc and I Saw :

Quote:Each of your sub-folders may contain a default controller which will be called if the URL contains only the sub-folder. Simply name your default controller as specified in your application/config/routes.php file
Ok but how assign the default-controller to my admin folder ?
Code:
$route['admin'] = 'login'
don't work....
Thank you for your help !
#2

[eluser]al3xandre[/eluser]
no one to help me ??
#3

[eluser]Michael Ekoka[/eluser]
try this:
Code:
// default controller
$routes['admin/?'] = 'admin/login';
Before you do however, you need to be aware that there currently is a bug in CI when trying to access controllers inside subfolders. If you're using the svn version of CI go here for a fix, else, if you're using the downloaded version go here instead.
#4

[eluser]esra[/eluser]
The next release of the Modular Separation contribution will include code for managing the routes for subfolders or multiple controllers stored in the same module directory structure. The Modular Separation project has been making a considerable number of improvements that work around some of CI's limitations. Check the Modular Separation thread for more details.
#5

[eluser]al3xandre[/eluser]
Thank you !

I'm quite surprised that it hasn't been fixed in the core yet




Theme © iAndrew 2016 - Forum software by © MyBB