Interface for Applications that leverage plugins & events.
Events can be bound to the application event manager during the application's bootstrap and plugin bootstrap.
Add a plugin to the loaded plugin set.
Wrapper for creating and dispatching events.
Returns the Cake\Event\EventManager manager instance for this object.
Run bootstrap logic for loaded plugins.
Run console hooks for plugins
Run middleware hooks for plugins
Run routes hooks for loaded plugins
Sets the Cake\Event\EventManager manager instance for this object.
addPlugin(Cake\Core\PluginInterface|string $name, array<string, mixed> $config = []): $this
Add a plugin to the loaded plugin set.
If the named plugin does not exist, or does not define a Plugin class, an instance of Cake\Core\BasePlugin
will be used. This generated class will have all plugin hooks enabled.
Cake\Core\PluginInterface|string
$name The plugin name or plugin object.
array<string, mixed>
$config optional The configuration data for the plugin if using a string for $name
$this
dispatchEvent(string $name, array|null $data = null, object|null $subject = null): Cake\Event\EventInterface
Wrapper for creating and dispatching events.
Returns a dispatched event.
string
$name Name of the event.
array|null
$data optional Any value you wish to be transported with this event to it can be read by listeners.
object|null
$subject optional The object that this event applies to ($this by default).
Cake\Event\EventInterface
getEventManager(): Cake\Event\EventManagerInterface
Returns the Cake\Event\EventManager manager instance for this object.
Cake\Event\EventManagerInterface
pluginBootstrap(): void
Run bootstrap logic for loaded plugins.
void
pluginConsole(Cake\Console\CommandCollection $commands): Cake\Console\CommandCollection
Run console hooks for plugins
Cake\Console\CommandCollection
$commands The CommandCollection to use.
Cake\Console\CommandCollection
pluginMiddleware(Cake\Http\MiddlewareQueue $middleware): Cake\Http\MiddlewareQueue
Run middleware hooks for plugins
Cake\Http\MiddlewareQueue
$middleware The MiddlewareQueue to use.
Cake\Http\MiddlewareQueue
pluginRoutes(Cake\Routing\RouteBuilder $routes): Cake\Routing\RouteBuilder
Run routes hooks for loaded plugins
Cake\Routing\RouteBuilder
$routes The route builder to use.
Cake\Routing\RouteBuilder
setEventManager(Cake\Event\EventManagerInterface $eventManager): $this
Sets the Cake\Event\EventManager manager instance for this object.
You can use this instance to register any new listeners or callbacks to the object events, or create your own events and trigger them at will.
Cake\Event\EventManagerInterface
$eventManager the eventManager to set
$this
© 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.PluginApplicationInterface.html