Search code examples
codeigniterhmvcmodular

Code Igniter Modular Extensions Default_controller


I am currently designing an application that needs to be modular - for this i am using the Modular Extensions - HMVC for code igniter.

I am trying to change the default_controller as defined in the application/config/config.php file to default to a module controller, for example: users/controllers/login, however no matter what i put into the default_controller setting i get 404 pages.

I have tried the following to no avail:

 $route['default_controller'] = "index.php/modules/core/controllers/login";
 $route['default_controller'] = "/modules/core/controllers/login";
 $route['default_controller'] = "login";
 $route['default_controller'] = "./modules/core/controllers/login";
 $route['default_controller'] = APPPATH."/application/modules/core/controllers/login";

As you can tell my modules directory is in application/modules/ Any ideas are much appreciated.


Solution

  • you have to use module_name/controller_name

    if your module is users and controller is login then default is written as

     $route["default_controller"] = "users/login";