Controllers/Classes not loading... |
[eluser]tamilsweet[/eluser]
I'm facing a strange issue. All the url requests goes to the default controller/class. Other classes aren't loading??? How do i debug this?
[eluser]xwero[/eluser]
check the routes.php file. There is no default controller in CI only a default controller method.
[eluser]tamilsweet[/eluser]
This is what I have in routes.php $route['default_controller'] = "my_admin"; I have, class My_admin extends Controller { and class My_login extends Controller { http://mysite.com/index.php/my_login/ goes to My_admin !!!??
[eluser]xwero[/eluser]
The default controller is not really a default controller. It is the controller that only gets loaded when the uri has no segments. maybe it should be renamed to landing_controller? Why do you add the MY_ prefix this looks ugly in the url. If the idea is to create extended controller classes you put them in the MY_controller file. Then they are loaded automagically. Then you create a controller that gets called by the url and extend that controller with a controller from the MY_controller file. Code: // MY_controller.php What is your file structure?
[eluser]FragPacket[/eluser]
Sounds like you and I are having the same problem... http://ellislab.com/forums/viewthread/99891/
[eluser]tamilsweet[/eluser]
Hi xwero, Thanks for the response. I'm new to CI and I should first read the documentation properly. Those weren't extended controller classes. I will rename them as you suggested. I fixed the issue somehow. * Added the htaccess rule * Removed index.php in line => $config['index_page'] = ""; * Changed uri protocol to => $config['uri_protocol'] = "REQUEST_URI"; After these changes I'm able to get the code working properly. Hello FragPacket, May be you could try this !? |
Welcome Guest, Not a member yet? Register Sign In |