Conventions
By convention, any interceptor CFC must create a method with the same name as the event they want to listen to. This method has a return type of boolean
and receives 5 arguments. So let's explore their rules.
Arguments
event
which is the request context objectdata
which is a structure of data that the broadcaster sendsbuffer
which is a request buffer object you can use to elegantly produce content that is outputted to the user's screenrc
reference to the request collection structprc
reference to the private request collection struct
Return type
The intercepting method returns boolean
or void
. If boolean then it means something:
True means break the chain of execution, so no other interceptors in the chain will fire.
False or
void
continue execution
Also remember that all interceptors are created by WireBox, so you can use dependency injection, configuration binder's, and even AOP on interceptor objects. Here is a more complex sample:
HTTP Security Example:
Last updated