Base Plugin Class
Every plugin should extends from this class or implement the interfaces and include a plugin class in it's src root folder.
$bootstrapEnabled protected boolean$classPath protected string$configPath protected string$consoleEnabled protected boolean$middlewareEnabled protected boolean$name protected string$path protected string$routesEnabled protected boolean__construct( array $options = [] )
Constructor
$options optional [] bootstrap( Cake\Core\PluginApplicationInterface $app )
Load all the application configuration and bootstrap logic.
Cake\Core\PluginApplicationInterface $app Cake\Core\PluginInterface::bootstrap() checkHook( string $hook )
Check if a hook name is valid
$hook console( Cake\Console\CommandCollection $commands )
Add console commands for the plugin.
Cake\Console\CommandCollection $commands Cake\Console\CommandCollectionCake\Core\PluginInterface::console() disable( string $hook )
Disables the named hook
$hook Cake\Core\PluginInterface::disable() enable( string $hook )
Enables the named hook
$hook Cake\Core\PluginInterface::enable() getClassPath( )
Get the filesystem path to configuration for this plugin
Cake\Core\PluginInterface::getClassPath() getConfigPath( )
Get the filesystem path to configuration for this plugin
Cake\Core\PluginInterface::getConfigPath() getName( )
Get the name of this plugin.
Cake\Core\PluginInterface::getName() getPath( )
Get the filesystem path to this plugin
Cake\Core\PluginInterface::getPath() initialize( )
isEnabled( string $hook )
Check if the named hook is enabled
$hook Cake\Core\PluginInterface::isEnabled() middleware( Cake\Http\MiddlewareQueue $middleware )
Add middleware for the plugin.
Cake\Http\MiddlewareQueue $middleware Cake\Http\MiddlewareQueueCake\Core\PluginInterface::middleware() routes( Cake\Routing\RouteBuilder $routes )
Add routes for the plugin.
Cake\Routing\RouteBuilder $routes Cake\Core\PluginInterface::routes()
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.8/class-Cake.Core.BasePlugin.html