RE: [coldbox:17856] Re: [coldbox 3.5.3] Referencing datasource bean in wirebox config.cfc

When you use WireBox inside of ColdBox, all the ColdBox settings are passed into the binder config as properties. You can deal with them using the following methods:

  • getProperty(name,[default]) : Get a specific property
  • getProperties() : Get all the properties structure
  • propertyExists(name) : Check if a property exists
  • setProperty(name,value) : Dynamically add properties to the structure

The docs for that are here: http://wiki.coldbox.org/wiki/WireBox.cfm#Binder_Configuration_Properties

So, your case you’d want to do something like this: getProperty(“datasources”).nameOfDataSource

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hey Brad,

Just noticed for some reason your initial replies to the threads are creating a new thread, is that deliberate?

Best,