[coldbox:12874] Accessing vars from Coldbox.cfc in the View

Put it in settings and use #getSetting(“settingName”)#.

Okay. Then, on the other side, how would I get to these values from
within the model? Is it something I can use Inject for like with


Rob, this is the DSL for injecting a setting...

property name="{setting}" inject=" coldbox:setting:{setting}";

Hope that helps,
Curt Gratz

In general, MVC design patterns dictate that you should be marshalling
your data in the Controller (handler in ColdBox) and then handing the
data off to your Model and your View.

So you would inject the setting into your handler as Brad mentioned,
then pass that value into your Model as an argument and if you need
that value in your View, you'd put it in the RequestCollection.

In code, in your handler:

<cfproperty name="settingName" inject="coldbox:setting:settingName"
scope="variables" />

var theThingINeedFromMyModel = oSomeService.someMethod(theSetting=settingName);

rc.settingName = settingName;

and then in your View:


Hope that helps,

+1 for having your model clean and passing in the setting.