User Settings
The defaults for a module is stored in a settings struct in the ModuleConfig.cfc for that module. However, users can override those settings without needing to touch the core module code. This is made possible by special namespace in the CommandBox config settings called modules.
Consider the following module settings:
/modules/TestModule/ModuleConfig.cfc
1
component{
2
function configure(){
3
settings = {
4
mySetting = 'isCool',
5
somethingEnabled = true
6
};
7
}
8
}
Copied!
The following config set commands will create config settings that override those. The pattern is modules.moduleName.settingName.
1
config set modules.TestModule.mySetting=overridden
2
config set modules.TestModule.somethingEnabled=false
Copied!
When a module is loaded, the config settings (that exist) for that module are also loaded and overwrite the defaults from ModuleConfig.cfc. You can easily see what settings are set for our TestModule like so:
1
config show modules.TestModule
Copied!
Copy link
Edit on GitHub