Hi
I have just created a module called Admin
Inside admin i have a config folder with a file called css.php
Structure:
admin
- config
- - css.php
I whant to load this file automatically
the css.php file contains:
<?php
return array(
'css' => array('path/to/css/file.css')
);
?>
----
I have tryed to include the file trough app/config/config.php
like this.
'config' => array(
'css'=>'modulename::config/css'
),
But no luck.
The best solution for me would be that it merged my
app/config/css.php file with module/admin/config/css.php file and just extend the css array with file paths.
I dont know what the best practice is here.
When you load a config file (using \Config::load()), it will load all files it can find, and merge them (either in merge or in overwrite mode depending on the parameter).
It will search (and load) in this order:
- COREPATH
- PACKAGEPATH (all loaded packages)
- APPPATH
- module (if called from a module)
If you want to load something in a module from outside the module, your first stop is to re-evaluate your architecture. Modules should be independent, there should not be any cross-module calling or app-module calling (other then through HMVC).