Plugins:MethodInjector
last edited by
lmajano
on 11-Apr-2010
|
Exploring the MethodInjector Plugin
Overview
Method Injector plugin. It provides a nice way to mixin and remove methods from cfc's
injectPropertyMixin
injects a property into the passed scope
Returns
- This function returns void
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| propertyName | string | Yes | --- | The name of the property to inject. |
| propertyValue | any | Yes | --- | The value of the property to inject |
| scope | string | No | variables | The scope to which inject the property to. |
Examples
removePropertyMixin
removes a property from the cfc used.
Returns
- This function returns void
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| propertyName | string | Yes | --- | The name of the property to remove. |
| scope | string | No | variables | The scope to which inject the property to. |
Examples
getcontroller
Get controller: coldbox.system.web.Controller
Returns
- This function returns any
Examples
removeMixin
removes a method in a CFC
Returns
- This function returns void
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| UDFName | string | Yes | --- | Name of the UDF to be removed |
Examples
injectMixin
injects a method into the CFC scope
Returns
- This function returns void
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| UDF | any | Yes | --- | UDF to be checked |
Examples
invokerMixin
calls private/packaged/public methods
Returns
- This function returns any
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| method | string | Yes | --- | Name of the private method to call |
| argCollection | struct | No | --- | Can be called with an argument collection struct |
| argList | string | No | --- | Can be called with an argument list, for simple values only: ex: 'plugin=logger,number=1' |
Examples
setcontroller
Set controller
Returns
- This function returns void
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| controller | any | Yes | --- | coldbox.system.web.Controller |
Examples
stop
stop injection block. Removes mixed in methods.
Returns
- This function returns void
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| CFC | any | Yes | --- | The cfc to inject the method into |
Examples
populatePropertyMixin
Populates a property if it exists
Returns
- This function returns void
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| propertyName | string | Yes | --- | The name of the property to inject. |
| propertyValue | any | Yes | --- | The value of the property to inject |
| scope | string | No | variables | The scope to which inject the property to. |
Examples
start
start method injection set. Injects: injectMixin,removeMixin,invokerMixin,injectPropertyMixin,removePropertyMixin
Returns
- This function returns void
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| CFC | any | Yes | --- | The cfc to inject the method into |

SideBar
User Login 




Comments (