External modules allow you to create modular packages of related event handlers and views that can reside outside of the application’s tree. This separation allows for better organization of the application code in large applications, and also provides a base for creating “pluggable” solutions in which new application modules can be added in the forms of packages.
Modules are defined as subdirectories of the “Modules Root”. The location where the modules are stored is given by the this.modulesPath setting in Application.cfc.
Each module subdirectory itself is must contain two subdirectories: handlers and views.
To call an event handler located in an external module use the format:
module.handler.event
Where module is the name of the folder within the location of the modules directory, handler is the CFC containing the event handler and event is the name of the method in the CFC that will handle the event.
When executing an event handler within an external module, all views are always relative to the views directory of the module. This means that event handlers in external modules can only render their own views.
