Plugin
extends BasePlugin
in package
CakePHP Utilities Plugin
The main entrypoint of this plugin.
Table of Contents
Properties
- $bootstrapEnabled : bool
- Do bootstrapping or not
- $classPath : string
- The class path for this plugin.
- $configPath : string
- The config path for this plugin.
- $consoleEnabled : bool
- Console middleware
- $middlewareEnabled : bool
- Enable middleware
- $name : string
- The name of this plugin
- $path : string
- The path to this plugin.
- $routesEnabled : bool
- Load routes or not
- $servicesEnabled : bool
- Register container services
- $templatePath : string
- The templates path for this plugin.
Methods
- __construct() : mixed
- Constructor
- bootstrap() : void
- Bootstraping for this specific plugin.
- console() : CommandCollection
- Add console commands for the plugin.
- disable() : $this
- Disables the named hook
- enable() : $this
- Enables the named hook
- getClassPath() : string
- Get the filesystem path to configuration for this plugin
- getConfigPath() : string
- Get the filesystem path to configuration for this plugin
- getName() : string
- Get the name of this plugin.
- getPath() : string
- Get the filesystem path to this plugin
- getTemplatePath() : string
- Get the filesystem path to templates for this plugin
- initialize() : void
- Initialization hook called from constructor.
- isEnabled() : bool
- Check if the named hook is enabled
- middleware() : MiddlewareQueue
- Add middleware for the plugin.
- routes() : void
- Add plugin specific routes here.
- services() : void
- Register container services for this plugin.
- checkHook() : void
- Check if a hook name is valid
Properties
$bootstrapEnabled
Do bootstrapping or not
protected
bool
$bootstrapEnabled
= true
$classPath
The class path for this plugin.
protected
string
$classPath
$configPath
The config path for this plugin.
protected
string
$configPath
$consoleEnabled
Console middleware
protected
bool
$consoleEnabled
= true
$middlewareEnabled
Enable middleware
protected
bool
$middlewareEnabled
= true
$name
The name of this plugin
protected
string
$name
$path
The path to this plugin.
protected
string
$path
$routesEnabled
Load routes or not
protected
bool
$routesEnabled
= true
$servicesEnabled
Register container services
protected
bool
$servicesEnabled
= true
$templatePath
The templates path for this plugin.
protected
string
$templatePath
Methods
__construct()
Constructor
public
__construct([array<string, mixed> $options = [] ]) : mixed
Parameters
- $options : array<string, mixed> = []
-
Options
bootstrap()
Bootstraping for this specific plugin.
public
bootstrap(PluginApplicationInterface $app) : void
Parameters
- $app : PluginApplicationInterface
-
The app object.
console()
Add console commands for the plugin.
public
console(CommandCollection $commands) : CommandCollection
Parameters
- $commands : CommandCollection
-
The command collection to update
Tags
Return values
CommandCollectiondisable()
Disables the named hook
public
disable(string $hook) : $this
Parameters
- $hook : string
-
The hook to disable
Tags
Return values
$thisenable()
Enables the named hook
public
enable(string $hook) : $this
Parameters
- $hook : string
-
The hook to disable
Tags
Return values
$thisgetClassPath()
Get the filesystem path to configuration for this plugin
public
getClassPath() : string
Tags
Return values
stringgetConfigPath()
Get the filesystem path to configuration for this plugin
public
getConfigPath() : string
Tags
Return values
stringgetName()
Get the name of this plugin.
public
getName() : string
Tags
Return values
stringgetPath()
Get the filesystem path to this plugin
public
getPath() : string
Tags
Return values
stringgetTemplatePath()
Get the filesystem path to templates for this plugin
public
getTemplatePath() : string
Tags
Return values
stringinitialize()
Initialization hook called from constructor.
public
initialize() : void
isEnabled()
Check if the named hook is enabled
public
isEnabled(string $hook) : bool
Parameters
- $hook : string
-
The hook to check
Tags
Return values
boolmiddleware()
Add middleware for the plugin.
public
middleware(MiddlewareQueue $middlewareQueue) : MiddlewareQueue
Parameters
- $middlewareQueue : MiddlewareQueue
-
The middleware queue to update.
Tags
Return values
MiddlewareQueueroutes()
Add plugin specific routes here.
public
routes(RouteBuilder $routes) : void
Parameters
- $routes : RouteBuilder
-
The passed routes object.
services()
Register container services for this plugin.
public
services(ContainerInterface $container) : void
Parameters
- $container : ContainerInterface
-
The container to add services to.
checkHook()
Check if a hook name is valid
protected
checkHook(string $hook) : void
Parameters
- $hook : string
-
The hook name to check