How to check plugin loaded or not?

I added Plugin in bootstrap.php . So how did I check plugin loaded or not?

You can use Plugin::loaded('MyPlugin'); or use the shell to see what has been loaded:

# show all loaded plugins
bin/cake plugin loaded
# check for specific plugin (nix)
bin/cake plugin loaded | grep MyPlugin

I’ll necropost because this shows up on Google.

For 5.x, use api.cakephp.org/5.0/class-Cake.Core.Plugin.html#isLoaded():

$pluginName = 'BootstrapUI'; // for example
$isLoaded = \Cake\Core\Plugin::isLoaded($pluginName);
1 Like