\Cake\CorePluginInterface

Plugin Interface

Summary

Methods
Constants
getName()
getPath()
getConfigPath()
getClassPath()
bootstrap()
console()
middleware()
routes()
disable()
enable()
isEnabled()
VALID_HOOKS
No protected methods found
N/A
No private methods found
N/A

Constants

VALID_HOOKS

VALID_HOOKS = array('routes', 'bootstrap', 'console', 'middleware')

List of valid hooks.

Methods

getName()

getName() : string

Get the name of this plugin.

Returns

string

getPath()

getPath() : string

Get the filesystem path to this plugin

Returns

string

getConfigPath()

getConfigPath() : string

Get the filesystem path to configuration for this plugin

Returns

string

getClassPath()

getClassPath() : string

Get the filesystem path to configuration for this plugin

Returns

string

bootstrap()

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.

Parameters

\Cake\Core\PluginApplicationInterface $app

The host application

routes()

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.

Parameters

\Cake\Routing\RouteBuilder $routes

The route builder to update.

disable()

disable(string  $hook) : $this

Disables the named hook

Parameters

string $hook

The hook to disable

Returns

$this

enable()

enable(string  $hook) : $this

Enables the named hook

Parameters

string $hook

The hook to disable

Returns

$this

isEnabled()

isEnabled(string  $hook) : boolean

Check if the named hook is enabled

Parameters

string $hook

The hook to check

Returns

boolean