Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Addresses #6 by allowing getBean() to resolve constants.

Add isSingleton=true metadata for constants.
  • Loading branch information...
commit 05b273067f91955152eab250ed934613e15e4f8a 1 parent 7478b41
Sean Corfield authored

Showing 2 changed files with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. +1 1  ioc.cfc
  2. +2 1  views/main/default.cfm
2  ioc.cfc
@@ -304,7 +304,7 @@ component {
304 304
305 305 if ( structKeyExists( variables.config, 'constants' ) ) {
306 306 for ( var beanName in variables.config.constants ) {
307   - variables.beanInfo[ beanName ] = { value = variables.config.constants[ beanName ] };
  307 + variables.beanInfo[ beanName ] = { value = variables.config.constants[ beanName ], isSingleton = true };
308 308 }
309 309 }
310 310
3  views/main/default.cfm
@@ -9,4 +9,5 @@
9 9 <cfdump var="#user2.getItem()#" label="User 2's Item Bean"/>
10 10 <cfdump var="#bf.getBean('userservice')#" label="User Service"/>
11 11 <cfdump var="#bf.getBean('product')#" label="Product Service"/>
12   -<cfdump var="#bf.getBean('userbean').product.getUserService()#" label="bf.getBean('userbean').product.getUserService()"/>
  12 +<cfdump var="#bf.getBean('userbean').product.getUserService()#" label="bf.getBean('userbean').product.getUserService()"/>
  13 +<cfdump var="#bf.getBean('magicvalue')#" label="bf.getBean('magicvalue')"/>

0 comments on commit 05b2730

Please sign in to comment.
Something went wrong with that request. Please try again.