Site "eventHandler.cfc" File - Mura Docs v7.0

Site "eventHandler.cfc" File

As a CFML developer, you already know that CFML has its own request/event lifecycle. Mura also has its own request/event lifecycle, and will be covered in detail within the Mura Events section. That said, just as CFML has an Application.cfc to register event listeners/handlers, Mura checks each site for an eventHandler.cfc file, located under {context}/sites/{SiteID}/includes/eventHandler.cfc.

If the "Site eventHandler.cfc" file is found, Mura will automatically invoke the file on each request, and registers its event listeners/handlers with Mura. In addition to the site-specific eventHandler.cfc file, Mura also checks each theme for a theme-specific eventHandler.cfc file.

However, any changes made to the theme-specific file require you to reload Mura in order for the changes to get registered since the theme-specific file is only invoked when the application initially loads, and is not invoked on each request.

Again, we'll cover Mura's request/event lifecycle in the Mura Events section.