Codeigniter HMVC不加载配置文件

I am trying to load a file from config/common folder which does not load.

I downloaded codeigniter framework and HMVC framework from here and copied to third_party and core folder as per its description and created a config file under application->config->common->test_config.php like below

application
    config
       common
          test_config.php

i have controller (MY_Controller) under core folder and i want to load this file like $this->load->config(common/test); But it does not load test_config.php. Can someone give some clue to load this file.

Regards

Rabinarayan

You're using wrong/missing file. Download Codeigniter HMVC from here and Config file placed here


Structure will be

application
    config
        config.php

Note: Use PHP 5.6 or higher

I think that with CI-HMVC, the $this->config->load() method is looking for config files only inside folders called "config" in any paths loaded.

so if you really need subfolder, you have to create a 'config' folder within your 'subfolder' ... I'd advise you not to put them in the config folder of the application, but in the third_party folder

(note that this would probably work if you put this in the config folder but it seems a bit redundant to me to have config/subfolder/config/config_file - plus I'm sure this is not very orthodox )

third_party/
     subfolder/
          config/
             custom_config.php

then load the config/subfolder into CI as a path

$this->load->add_package_path(APPPATH.'third_party/subfolder');

and finally load your custom config file :

$this->config->load('custom_config');