\Cake\CorePluginApplicationInterface

Interface for Applications that leverage plugins & events.

Events can be bound to the application event manager during the application's bootstrap and plugin bootstrap.

Summary

Methods
Constants
dispatchEvent()
eventManager()
addPlugin()
pluginBootstrap()
pluginRoutes()
pluginMiddleware()
pluginConsole()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

dispatchEvent()

dispatchEvent(string  $name, array|null  $data = null, object|null  $subject = null) : \Cake\Event\Event

Wrapper for creating and dispatching events.

Returns a dispatched event.

Parameters

string $name

Name of the event.

array|null $data

Any value you wish to be transported with this event to it can be read by listeners.

object|null $subject

The object that this event applies to ($this by default).

Returns

\Cake\Event\Event

eventManager()

eventManager(\Cake\Event\EventManager|null  $eventManager = null) : \Cake\Event\EventManager

Returns 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.

Parameters

\Cake\Event\EventManager|null $eventManager

the eventManager to set

Returns

\Cake\Event\EventManager

addPlugin()

addPlugin(string|\Cake\Core\PluginInterface  $name, array  $config = array()) : $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.

Parameters

string|\Cake\Core\PluginInterface $name

The plugin name or plugin object.

array $config

The configuration data for the plugin if using a string for $name

Returns

$this

pluginBootstrap()

pluginBootstrap() : void

Run bootstrap logic for loaded plugins.