ColdBox 3.8.1 - Load Plugins at Startup

I was curious if it was possible for plugins to have a similar event lifecycle as modules, as in… pre/post ModuleLoad & pre/postModuleUnload intercept points, but for plugins?

After testing a few things, it seems plugins don’t get registered until they’re called or injected.

I’m working on a small project where, while I could use Modules, it seems way overkill and too many files when just 1 cfc would do.

That is correct, Plugins are not created until they are needed. If you need a lifecycle, that’s what modules are for. Alternatively, you can just map the Plugin as a model and set it to eagerInit().

Site note: we will be moving away from Plugins entirely in ColdBox 4 in favor of full blown modules, or regular WireBox models:



ColdBox Platform Evangelist
Ortus Solutions, Corp

ColdBox Platform:

Just remember that ColdBox is changing the way plugins work, I am guessing for the reason you just said. But that is in the CB 4.0 road map.

Ah Brad thanks for reminding me, I forgot wirebox has mapDirectory. That will work just fine.

Also, thanks for the heads up about deprecations.


Modules do not have to be many files. The ModuleConfig.cfc is in itself all you need for a module. So a module can be 1 CFC if you like.


Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
IECFUG Manager: