injector = createObject("component","wirebox.system.ioc.Injector").init();
injector = createObject("component","wirebox.system.ioc.Injector").init(binder="path.to.binder");
--You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.To post to this group, send email to col...@googlegroups.comTo unsubscribe from this group, send email to coldbox-u...@googlegroups.comFor more options, visit this group at http://groups-beta.google.com/group/coldboxFor News, visit http://blog.coldbox.orgFor Documentation, visit http://wiki.coldbox.org
onApplicationStart(), create WireBox with createObject().
> For example, when I create wirebox in the application.cfc does it inject itself into the application scope?
If you set set scope registration in the config, yes it will persist itself in whatever scope using whatever key you specify.
wirebox.scopeRegistration = {
enabled = true,
scope = "application", // server, cluster, session, application
key = "wireBox"
};
You can also manually set it into a scope if you wish.
> Does the binder.cfc get called? If so where and how?
You can create the binder.cfc and pass it in on the init of WireBox or you can tell WireBox where the config is located with an instantiation path and it will create it for you.
> I want to use mapDirectory. I assume I do that in the binder.cfc.
Yep. You can pretty much do the same stuff in a stand-alone WireBox install that you can do within ColdBox. A couple differences are that your ColdBox settings won't be passed in as properties (though you're free to pass in another struct of properties) and any ColdBox DSL obviously can't be built without an attached ColdBox instance.
Check out the docs for some examples of creating WireBox outside of ColdBox:
http://wiki.coldbox.org/wiki/WireBox.cfm
Thanks!
~Brad
Sent from my ASUS Eee Pad
injector = createObject("component","wirebox.system.ioc.Injector").init();
espresso = injector.getInstance("model.CoffeeShop");
Check out these to videos I made a while ago. They are both short and should help you get started.
http://vimeo.com/20937470
http://vimeo.com/20938425
Hope that helps.
Curt Gratz
Computer Know How
Hi Guys,
Thanks,
George Murphy
--