MapDirectory() Influence & Filters
// influence only certain components to be singleton
mapDirectory(packagePath="coldbox.testing.testModel.ioc", influence=function(binder, path){
if( findNoCase( "simple", arguments.path) ){
arguments.binder.asSingleton();
}
});
// filter some components from registration
mapDirectory(packagePath="coldbox.testing.testModel.ioc", filter=function(path){
return ( findNoCase( "simple", arguments.path ) ? false : true );
});Last updated
Was this helpful?