I'm currently working on module based application and came across some problem. Is there any way that one module can access config of another module ?
Tried Config::load() then Config::get()
and Module::load()
None of these will access the config file while it is in module directory. I can get configs when i move them to main config directory, but I want to fully separate module and its config from rest of the app.
I'm not sure the module has to be loaded for this, but you can test that.
but any hard-coded cross-module access is considered bad practice, as it violates loose coupling of modules, and blocks easy re-usability of modules.
It is better to make sure modules are self-contained, and only have an interface with the outside world (= anything outside the module) through HMVC calls.
PS. What i'm trying to get is self configuring app, following one simple convention. One of the modules "manager" is looking for all uploaded modules and building all menu and available actions out of info stored on each module config files.
May rethink the idea to use HMVC calls, but for now I need to move whole thing from old Kohana core to Fuel.