RE: [coldbox:18179] Re: [coldbox 3.6.0] Question on using an injected object in another objects Init.

The other way to handle this if you want to stick with mixin injection, is to move the logic out of init() and into a onDIComplete() method. This is the order that CFCs are dealt with when they are built with WireBox

  1. createObject(‘yourCFC’)
  2. yourCFC.init() ← constructor args passed here if any exist
  3. autowire(youCFC) ← This is where mixin injection happens
  4. yourCFC.onDIComplete() ← Now you have access to everything.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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