0
votes

I have and CI hmvc structure as below:

  • application
    • config
      • config.php
      • routes.php
    • ...
    • modules
      • login
      • personal
        • config
          • config.php
          • routes.php
        • controllers
        • libraries
        • models
        • views

HMVC works fine. So, here's my problem: Inside /modules/personal/config/routes.php i have this:

$route['personal/empleados/actualizar.legajo'] = 'personal/empleados/actualizar_legajo/'; $route['personal/empleados/nuevo-cargo'] = 'personal/empleados/nuevo_cargo/';

But it doen't work. The file is loaded but routing doesn't work.

If i cut and copy these two lines and paste them inside: /application/config/routes.php, works.

Can anybody tell me why ? Because i have several modules and i would like to do this inside each modules/module-name/config/config.php

Thanx, in advance.

2

2 Answers

0
votes

Have you tried to set the default controller in each module ? You may also need to add the folder path.

modules/personal/config/routes.php

$route['default_controller'] = 'personal';

// OR //

$route['default_controller'] = 'personal/personal';
0
votes

Thanx for your answer. I set my default controller as you tell but it fails anyway. On the other hand i found a solution (?) as follow on modules/module-name/config/routes.php

$route['personal/empleados/nuevo.cargo'] = 'empleados/nuevo_cargo/';

and... IT WORKS. I don't know why. But it works.