CBWIRE uses WireBox internally to load your components. Any lifecycle methods fired by WireBox are available to you.
Getting Instances
You can use getInstance() to access a dependency from within your actions.
// ./wires/Posts.cfc
component extends="cbwire.models.Component" {
function allPosts() {
var postService = getInstance( "PostService" );
return postService.getAll();
}
}
Here is the method signature for getInstance():
/**
* Get a instance object from WireBox
*
* @name The mapping name or CFC path or DSL to retrieve
* @initArguments The constructor structure of arguments to passthrough when initializing the instance
* @dsl The DSL string to use to retrieve an instance
*
* @return The requested instance
*/
function getInstance( name, initArguments={}, dsl )