CodeIgniter Forums

Full Version: Controllers/Classes not loading...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

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?

El Forum

check the routes.php file.

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

El Forum

This is what I have in routes.php
$route['default_controller'] = "my_admin";

I have,
class My_admin extends Controller {
class My_login extends Controller { goes to My_admin !!!??

El Forum

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.
// 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?

El Forum

Sounds like you and I are having the same problem...

El Forum

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 !?