Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 904 Bytes

configuration_interceptor.md

File metadata and controls

19 lines (14 loc) · 904 Bytes

Configuration As An Interceptor

Another cool concept for the Configuration CFC is that it is also registered as a ColdBox Interceptor once the application starts up automatically for you. This means that you can create interception points in this CFC that will be registered upon application startup so you can define startup procedures, listen to events, etc.

function preProcess(event, interceptData, buffer){
    writeDump( 'I just hijacked your app!' );abort;
}

Note that the config CFC does not have the same variables mixed into it that a "normal" interceptor has. You can still access everything you need, but will need to get it from the controller in the variables scope.

function preRender(event, interceptData, buffer){
    controller.getWirebox().getInstance( 'loggerService' ).doSomething();
}