Codeigniter HMVC modules locations

2.3k Views Asked by At

In my codeigniter application I'm using codeigniter HMVC. And it works fantastic!

But I want to have 2 modules folders:

  • one in the application/controllers/ folder
  • and one in the applications/ folder.

I can't figure out how I need to change the modules_location array so this will work. At this moment my modules_location looks like this :

$config['modules_locations'] = array(
    APPPATH.'modules/' => '../modules/',
);

I just need to add one line to make this system working, but which one?

1

There are 1 best solutions below

2
AchrafSoltani On

I'm doing it this way :

$config['modules_locations'] = array(
    APPPATH.'modules/core/' => '../modules/core/',
    APPPATH.'modules/plugins/' => '../modules/plugins/',
);

and it's working as expected.

I have tried to externalize the modules root outside of the application folder but no success so far, I'll keep testing and let you know if it works and if I don't forget to post it here.

Cheers !