...
Warning | ||
---|---|---|
| ||
Blesta v4.3.0 has deprecated and replaced the EventObject $event that is passed to your event callback. Plugins will still be passed an EventObject for backward compatibility, but this will be replaced by a \Blesta\Core\Util\Events\Common\EventInterface in the future, which supports the same methods and data. This means that your plugin implementation should not check for an EventObject type unless you also support a type check on \Blesta\Core\Util\Events\Common\EventInterface. |
...
Code Block | ||||
---|---|---|---|---|
| ||||
<?php class MyPluginPlugin extends Plugin { ... public function getEvents() { return array([ array([ 'event' => "Appcontroller.preAction", 'callback' => array("this", "run") )] // Add multipleadditional events here )]; } public function run($event) { // This will execute when the "Appcontroller.preAction" event is triggered } } |
...