WireBox Listeners
Last updated
Last updated
In our previous section, we have seen all the events WireBox announces, but how do we listen? There are two ways to build WireBox listeners because there are two modes of operation, but the core is the same.
Listeners are simple CFCs who must create methods that match the name of the event they want to listen to.
If you are running WireBox within a ColdBox application, listeners are Interceptors and you declare them and register them the same way you do with normal interceptors.
These methods can take up to two parameters depending on your mode of operation (standalone or ColdBox). The one main difference between pure Wirebox listeners and ColdBox interceptors is that the configure
method for the standalone WireBox is different.
ColdBox Listeners
Standalone Listeners