Skip to content

Instantly share code, notes, and snippets.

@elpete
Last active October 7, 2016 16:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elpete/0a69b67e829eff4ee180beb5a5622593 to your computer and use it in GitHub Desktop.
Save elpete/0a69b67e829eff4ee180beb5a5622593 to your computer and use it in GitHub Desktop.
Add a ColdBox `applicationHelper` from a module
component {
function configure() {}
function onLoad() {
var helpers = controller.getSetting( "applicationHelper" );
arrayAppend(
helpers,
"#moduleMapping#/models/ModuleApplicationHelper.cfm"
);
controller.setSetting( "applicationHelper", helpers );
}
function onUnload() {
controller.setSetting(
"applicationHelper",
arrayFilter( controller.getSetting( "applicationHelper" ), function( helper ) {
return helper != "#moduleMapping#/models/ModuleApplicationHelper.cfm";
} )
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment