Codeigniter HMVC loading custom config file

2.3k views Asked by At

Im using HMVC extension in CodeIgniter. Where i have a module like

 moduleName
     config 
         config.php
         routes.php
     controller
         test.php
     models
         etc..

from test.php i was trying to load custom config item from above module folder. But its not working. im extending my class like class Test extends MX_Controller {}

I tried loading config item from default config folder which is outside the module folder and its working

According to this post, module config should load when module is initialized. But its not working.

What am i missing here?

1

There are 1 answers

0
Minhaz On

Codeignitor dose not load the config from modules folder by default. Its look on application/config folder, First its look on the ENVIRONMENT folder in case you have application/config/development .....

To load the config form the module you can use

$this->load->config('../models/config/XXX.php')  

Or you have to extend the Config class to modify your way