• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controllers/Classes not loading...

#1
[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?

#2
[eluser]xwero[/eluser]
check the routes.php file.

There is no default controller in CI only a default controller method.

#3
[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 !!!??

#4
[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
class Admin extends Controller {}
class Login extends Controller {}
// controller that gets called by a url
class Users extends Admin {}

What is your file structure?

#5
[eluser]FragPacket[/eluser]
Sounds like you and I are having the same problem...

http://ellislab.com/forums/viewthread/99891/

#6
[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 !?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.