Welcome Guest, Not a member yet? Register   Sign In
Behavior of default controllers in sub-folders
#1

[eluser]Bryan Zera[/eluser]
NOTE: My default_controller is set to 'main'

In the app that I'm developing, the URL

Code:
phonebook/

successfully loads the index function from the file

Code:
controllers/phonebook/main.php

Ideally, the URL

Code:
phonebook/view_departments/123

would point to the view_departments function of

Code:
controllers/phonebook/main.php

but instead it looks for the 123 function in the file

Code:
controllers/phonebook/view_departments.php

Which errors out because the file 'view_departments.php' doesn't exist. In order to get to the view_departments function, I have to explicitly put the default controller in the URL

Code:
phonebook/main/view_departments/123

My dream is that CI to be smart enough to know that if it doesn't find the 'view_departments' segment as a controller, it should pass it as a function name to the default controller.

While I bang away at some routes to solve the problem, has anyone else had this problem and if so, how did you circumnavigate having to explicitly declare the default controller in the URL when you put your controllers in subdirectories?


Messages In This Thread
Behavior of default controllers in sub-folders - by El Forum - 02-26-2008, 12:31 PM
Behavior of default controllers in sub-folders - by El Forum - 02-26-2008, 02:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB