CodeIgniter Forums
routes.php in HMVC not working - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: routes.php in HMVC not working (/showthread.php?tid=56490)



routes.php in HMVC not working - El Forum - 12-23-2012

[eluser]Unknown[/eluser]
Hi everyone, I have created a administration module, if i type
Quote:http://localhost/administration/login
, its succesful redirecting to the administration module and loading the login controller, but now i want to define the login controller as the default controller, that way if i type
Quote:http://localhost/administration
the login method should be loaded.

I know that its posible to have the same application folder structure within the module folder, so i have created a config folder and within it a routes.php file whit this content:
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$route['default_controller'] = 'login';
$route['404_override'] = '';

But this is not working, what i a missing ?


routes.php in HMVC not working - El Forum - 12-23-2012

[eluser]wiredesignz[/eluser]
This is described in the Modular Extensions - HMVC documentation.
Quote:Each module may contain a config/routes.php file where routing and a default controller can be defined for that module using:
Code:
$route['module_name'] = 'controller_name';

ie: {modules}/administration/config/routes.php
Code:
$route['administration'] = 'login';



routes.php in HMVC not working - El Forum - 12-23-2012

[eluser]Unknown[/eluser]
Thanks, now it works as expected.