Plugin Interface
array<string>
['bootstrap', 'console', 'middleware', 'routes', 'services']
List of valid hooks.
Load all the application configuration and bootstrap logic.
Add console commands for the plugin.
Disables the named hook
Enables the named hook
Get the filesystem path to configuration for this plugin
Get the filesystem path to configuration for this plugin
Get the name of this plugin.
Get the filesystem path to this plugin
Get the filesystem path to templates for this plugin
Check if the named hook is enabled
Add middleware for the plugin.
Add routes for the plugin.
Register plugin services to the application's container
bootstrap(Cake\Core\PluginApplicationInterface $app): void
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.
Cake\Core\PluginApplicationInterface
$app The host application
void
console(Cake\Console\CommandCollection $commands): Cake\Console\CommandCollection
Add console commands for the plugin.
Cake\Console\CommandCollection
$commands The command collection to update
Cake\Console\CommandCollection
disable(string $hook): $this
Disables the named hook
string
$hook The hook to disable
$this
enable(string $hook): $this
Enables the named hook
string
$hook The hook to disable
$this
getClassPath(): string
Get the filesystem path to configuration for this plugin
string
getConfigPath(): string
Get the filesystem path to configuration for this plugin
string
getName(): string
Get the name of this plugin.
string
getPath(): string
Get the filesystem path to this plugin
string
getTemplatePath(): string
Get the filesystem path to templates for this plugin
string
isEnabled(string $hook): bool
Check if the named hook is enabled
string
$hook The hook to check
bool
middleware(Cake\Http\MiddlewareQueue $middlewareQueue): Cake\Http\MiddlewareQueue
Add middleware for the plugin.
Cake\Http\MiddlewareQueue
$middlewareQueue The middleware queue to update.
Cake\Http\MiddlewareQueue
routes(Cake\Routing\RouteBuilder $routes): void
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.
Cake\Routing\RouteBuilder
$routes The route builder to update.
void
services(Cake\Core\ContainerInterface $container): void
Register plugin services to the application's container
Cake\Core\ContainerInterface
$container void
© 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.4/interface-Cake.Core.PluginInterface.html