The configure() Method
Once the public properties are set, we are now ready to configure our module. You will do this by creating a simple method called configure()
and adding variables to the following configuration structures:
Property
Type
Description
parentSettings
struct
Settings that will be appended and override the host application settings
settings
struct
Custom module settings that will only be available to the module. If parseParentSettings
is set to true (default), then settings from config/Coldbox.cfc
for this module will be merged with these settings. (Think of these as default settings in that case.) Please see the retrieving settings section
conventions
struct
A structure that explains the layout of the handlers, plugins, layouts and views of this module.
datasources
struct
A structure of datasource metadata that will append and override the host application datasources configuration
interceptorSettings
struct
A structure of settings for interceptor interactivity which includes the following sub-keys:
interceptors
array of structs
layoutSettings
struct
A structure of elements that setup layout configuration data for the module with the following keys:
routes
array
wirebox
struct
It is important to note that there is only ONE running application and the modules basically leach on to it. So the following structures will append their contents into the running application settings: parentSettings, datasources, webservices, customInterceptionPoints and interceptors.
All of the configuration settings that are declared in your configuration object will be added to a key in the host application settings called modules. Inside of this structure all module configurations will be stored according to their module name and remember that the module name comes from the name of the directory on disk. So if you have a module called helloworld then the settings will be stored in the following location: ConfigSettings.modules.helloworld
Below is an example of some settings:
Last updated