Interface PluginInterface
Plugin Interface
Constants summary
-
string[]VALID_HOOKS['routes', 'bootstrap', 'console', 'middleware']
Method Summary
Method Detail
bootstrap() public
bootstrap(\Cake\Core\PluginApplicationInterface $app)
Load all the application configuration and bootstrap logic.
The default implementation of this method will include the config/bootstrap.php in the plugin if it exist. You can override this method to replace that behavior.
The host application is provided as an argument. This allows you to load additional plugin dependencies, or attach events.
Parameters
-
\Cake\Core\PluginApplicationInterface$app The host application
console() public
console(\Cake\Console\CommandCollection $commands)
Add console commands for the plugin.
Parameters
-
\Cake\Console\CommandCollection$commands The command collection to update
Returns
\Cake\Console\CommandCollectiondisable() public
disable(string $hook)
Disables the named hook
Parameters
-
string$hook The hook to disable
Returns
$thisenable() public
enable(string $hook)
Enables the named hook
Parameters
-
string$hook The hook to disable
Returns
$thisgetClassPath() public
getClassPath()
Get the filesystem path to configuration for this plugin
Returns
stringgetConfigPath() public
getConfigPath()
Get the filesystem path to configuration for this plugin
Returns
stringgetName() public
getName()
Get the name of this plugin.
Returns
stringgetPath() public
getPath()
Get the filesystem path to this plugin
Returns
stringgetTemplatePath() public
getTemplatePath()
Get the filesystem path to templates for this plugin
Returns
stringisEnabled() public
isEnabled(string $hook)
Check if the named hook is enabled
Parameters
-
string$hook The hook to check
Returns
boolmiddleware() public
middleware(\Cake\Http\MiddlewareQueue $middlewareQueue)
Add middleware for the plugin.
Parameters
-
\Cake\Http\MiddlewareQueue$middlewareQueue The middleware queue to update.
Returns
\Cake\Http\MiddlewareQueueroutes() public
routes(\Cake\Routing\RouteBuilder $routes)
Add routes for the plugin.
The default implementation of this method will include the config/routes.php in the plugin if it exists. You can override this method to replace that behavior.
Parameters
-
\Cake\Routing\RouteBuilder$routes The route builder to update.
© 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/4.0/interface-Cake.Core.PluginInterface.html