The configure() Method
function configure(){
// parent settings
parentSettings = {
woot = "Module set it!"
};
// module settings - stored in the main configuration settings struct as modules.{moduleName}.settings
settings = {
display = "core"
};
// layout settings
layoutSettings = {
defaultLayout = "MyModuleLayout.cfm"
};
// Module Conventions
conventions = {
handlersLocation = "handlers",
viewsLocation = "views",
layoutsLocation = "layouts",
pluginsLocation = "plugins",
modelsLocation = "model"
};
// datasources
datasources = {
mysite = {name="mySite", dbType="mysql", username="root", password="root"}
};
// SES Routes
routes = [
// load the routes.cfm in the config folder of the module
"config/routes",
// explicit route declared here
{pattern="/api-docs", handler="api",action="index"}
];
// Interceptor Config
interceptorSettings = {
customInterceptionPoints = "onModuleError"
};
interceptors = [
{name="modulesecurity",class="#moduleMapping#.interceptors.ModuleSecurity",
properties={
URLMatch = '/api-docs',
loginURL = '/api-docs/login'
}
];
// binder mappings
binder.map("MyModuleService").to("#moduleMapping#.model.ModuleService");
// or easy map entire directory
binder.mapDirectory("#moduleMapping#.model");
}Last updated
Was this helpful?