I have an application that needs to have some custom configuration… I looked through the docs and couldn’t find any examples of custom configuration. I just want to set some additional configuration options and then have the behavior of a handler change based on those values.
So, my questions, specifically, are:
how do I add custom configuration options on a per-environment basis?
how do I reference these custom configuration values inside a handler or view?
function workstation(){
settings.coffee = “Americano”;
}
function staging(){
settings.coffee = “Columbian”;
}
Once the settings are configured and executed by the environment interceptor you would just reference them as you would any other setting by getSetting(‘coffee’) and get a different value per-environment.
public function development()
{
settings.allowAPICache = false;
settings.allowDebugLogging = true;
}
//
// or another way would be…
//
public functiond development()
{
local.devSettings = {
allowAPICache = false
allowDebugLogging = true
}
structAppend(coldbox.settings,local.devSettings,true);
}