![]() |
Automatically load all config files (HMVC and subfolders) - 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: Automatically load all config files (HMVC and subfolders) (/showthread.php?tid=50195) |
Automatically load all config files (HMVC and subfolders) - El Forum - 03-18-2012 [eluser]Noobigniter[/eluser] Hello, I want to know if there is no better way to do what I'm doing exactly. I use a HMVC with modules and subfolders, everything works fine but each time the load configuration files is a daunting task to me. That's why I want to automatically load all the files in the folder modules configs AND subfolders. The first problem is that I have to copy this which is already in my application/config/config.php : Code: $config['modules_locations'] = array( The second problem is that I have to put my code in the file application/config/routes.php, otherwise it is impossible to properly use this file routes.php. Content of my application/config/routes.php Code: $rtlg = '(\w{2})'; # routing lang (de|en|fr|it|nl|ru) Do not there no way around it? If you have any ideas, let me know ![]() In advance thank you. Automatically load all config files (HMVC and subfolders) - El Forum - 03-19-2012 [eluser]Aken[/eluser] You can autoload config files in config/autoload.php Automatically load all config files (HMVC and subfolders) - El Forum - 03-21-2012 [eluser]Noobigniter[/eluser] Hello, Thank you for taking the time to respond. I tried, but it's not really what I want, actually I was trying to have all files of each module, in itself, but it is apparently not possible, at least with routes.php files. |