Is there a ColdBox-y way of listing all registered...
# box-products
r
Is there a ColdBox-y way of listing all registered handlers? I am working on a poc app and when a certain cookie exists there is an interceptor that overrides the current event using
event.overrideEvent
. Currently, if the override doesn’t exist I have it setup to show the 404 page. I would like to be able to check to see if the event exists before overriding it.
Basically, if the override doesn’t exist just ignore it and process the event normally
Sorry, I found the answer on the default app
#getSetting("RegisteredHandlers")#
👍🏼 1
The next question, is it possible to see if an action exists in a given handler
b
You'd have to get the handler instance or metadata and just check for the method
Actions are discovered at runtime, so ColdBox doesn't keep a list of them anywhere per se.
Also, keep in mind, stuff like
onMissingAction()
can be used to do cool dynamic stuff that you can't easily check for ahead of time https://coldbox.ortusbooks.com/the-basics/event-handlers/implicit-methods
👍 1
r
Thanks Brad, I think I was trying to over think it. I just extended my “development” handler from the “integrated” handler.