There are many interception points that occur during an MVC and Remote life cycle in a ColdBox application. We highly encourage you to follow our flow diagrams in our ColdBox Overview section so you can see where in the life cycle these events fire. Also remember that each event can pass a data structure that can be used in your application.
Interception Point
Intercept Structure
Description
preLayout
---
This occurs before any rendering or layout is executed
preRender
{renderedContent}
This occurs after the layout+view is rendered and this event receives the produced content
postRender
---
This occurs after the content has been rendered to the buffer output
preViewRender
view - The name of the view to render
This occurs before any view is rendered
postViewRender
All of the data above plus:
This occurs after any view is rendered and passed the produced content
preLayoutRender
layout - The name of the layout to render
This occurs before any layout is rendered
postLayoutRender
Everything above plus:
This occurs after any layout is rendered and passed the produced content
Interception Point
Intercept Structure
Description
afterConfigurationLoad
---
This occurs after the framework loads and your applications' configuration file is read and loaded. An important note here is that your application aspects have not been configured yet and no modules have been loaded.
afterAspectsLoad
---
This occurs after the configuration loads and the aspects have been configured. This is a great way to intercept on application start after all modules have loaded.
preReinit
---
This occurs every time the framework is re-initialized
onException
exception - The cfcatch exception structure
This occurs whenever an exception occurs in the system. This event also produces data you can use to respond to it.
onRequestCapture
---
This occurs once the FORM/URL variables are merged into the request collection but before any event caching or processing is done in your application. This is a great event to use for incorporating variables into the request collections, altering event caching with custom variables, etc.
onInvalidEvent
invalidEvent - The invalid event
This occurs once an invalid event is detected in the application. This can be a missing handler or action. This is a great interceptor to use to alter behavior when events do not exist or to produce 404 pages.
applicationEnd
---
This occurs when the application is stopped, typically on running ApplicationStop()
.
sessionStart
session structure
This occurs when a user's session starts
sessionEnd
sessionReference - A reference to the session structure
This occurs when a user's session ends
preProcess
---
This occurs after a request is received and made ready for processing. This simulates an on request start interception point. Please note that this interception point occurs before the request start handler.
preEvent
processedEvent - The event that is about to be executed
This occurs before ANY event execution, whether it is the current event or called via the run event method. It is important to note that this interception point occurs before the preHandler convention. (See Event Handler Guide Chapter)
postEvent
processedEvent - The event that is about to be executed
This occurs after ANY event execution, whether it is the current event or called via the run event method. It is important to note that this interception point occurs after the postHandler convention (See Event Handler Chapter)
postProcess
---
This occurs after rendering, usually the last step in an execution. This simulates an on request end interception point.
preProxyResults
{proxyResults}
This occurs right before any ColdBox proxy calls are returned. This is the last chance to modify results before they are returned.
Our caching engine, CacheBox, also announces several events during its life cycle, so please see The CacheBox Events Section as well.
WireBox also announces several other events in the object creation life cycles, so please see the WireBox events
Interception Point
Intercept Structure
Description
afterHandlerCreation
handlerPath - The handler path
This occurs whenever a handler is created
afterInstanceCreation
mapping - The object mapping
This occurs whenever a wirebox object is created
Interception Point
Intercept Structure
Description
preModuleLoad
{moduleLocation, moduleName}
This occurs before any module is loaded in the system
postModuleLoad
{moduleLocation, moduleName, moduleConfig}
This occurs after a module has been loaded in the system
preModuleUnload
{moduleName}
This occurs before a module is unloaded from the system
postModuleUnload
{moduleName}
This occurs after a module has been unloaded from the system