standalone wirebox question

I decided to experiment with wirebox in a cfwheels app. Is there any reason why my instantiation code wouldn’t work to set a scan location? when i call my getInstance method, passing it the name of a cfc in the scan location folder, it errors out with ‘requested instance not found’, but if i give it the entire path it retrieves it just fine.

Instantiation code:

<cfset application.wirebox = createObject(“component”,“wirebox.system.ioc.Injector”).init() />
<cfset application.wirebox.scanLocations=[“services”] />

Thanks!

Doug the second line does nothing. You need to use a wirebox binder to config the injector with. Then it will use your config there.

Now if you don’t want a config file then you can do this

Wirebox.getBinder().scanLocations( path )

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano

Ah, thanks Luis! The documentation is extremely thorough! Only, it’s lacking a “for dummies/quickstart/here’s a complete basic example” section. :slight_smile:

Yes, would love the help on that as well?

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano