Blog

Brad Wood

January 30, 2013

Spread the word


Share your thoughts

 

One of the handy things about the ColdBox settings CFC is you can store ad-hoc settings for your application which can be retrieved or injected anywhere in your application.  
 
Remember, since your settings config is just a struct in a CFC, you aren't limited to settings which are strings.  You can store pretty much any kind of setting that will fit into a ColdFusion variable.
 
// Custom Settings
settings = {
    useSkins = true,
    servers = ['web1','web2','web3','web4'],
    skinsPath = "views/skins",
    myUtil = createObject("component","#appmapping#.model.util.MyUtility")
};
 
// Add another late addition here
settings["setMe"] = {as = 'you wish'};
 
 
P.S. Don't forget, in your environment overrides you don't need to specify the entire settings struct again.  You can override individual settings by referencing them directly.
 
function stage() {
    settings.servers = ['stage1','stage2'];
}
 

Add Your Comment

Recent Entries

The hidden costs of outdated ColdFusion Apps (And how to fix them)

The hidden costs of outdated ColdFusion Apps (And how to fix them)

Is Your ColdFusion System Quietly Costing You More Than You Think?

Many organizations continue to rely on ColdFusion systems that haven’t been updated in years. While these systems may still be running, they often come with hidden operational, financial, and security costs that can compound over time.

In this article, we’ll explore the true cost of maintaining legacy ColdFusion applications—and how teams can start reducing that burden through ...

Cristobal Escobar
Cristobal Escobar
March 26, 2025
ContentBox v6.1 Released

ContentBox v6.1 Released

In this release, we're thrilled to unveil a series of significant enhancements and upgrades to ContentBox designed to elevate your experience and considerably improve system performance. Our team has focused on integrating the latest CommandBox migrations and ColdBox Core, which ensures that the core system continues to operate with maximum efficiency and stability. This upgrade is part of our ongoing commitment to maintaining a cutting-edge platform that meets the evolving needs of our users.

Luis Majano
Luis Majano
March 19, 2025