WebPlatesEvent events
3 FeatherPanel plugin events on WebPlatesEvent (3 emitted by the core): the event names, the arguments each listener gets, where they fire and a PHP listener for each.
Last synced from FeatherPanel 15b94e9 on .
On this page
Part of the plugin events reference. Listeners get the payload values as positional arguments in the order shown, cannot cancel the action, and must catch their own exceptions.
Setup
Import WebPlatesEvent in your entry class and register listeners in processEvents():
<?php
namespace App\Addons\myplugin;
use App\App;
use App\Plugins\AppPlugin;
use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\WebPlatesEvent;
class MyPlugin implements AppPlugin
{
public static function processEvents(PluginEvents $event): void
{
$event->on(WebPlatesEvent::onWebPlateUpdated(), function ($webplateId, $webplate): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:web_plates:plate:updated ' . json_encode(['webplate_id' => $webplateId, 'webplate' => $webplate]));
});
}
public static function pluginInstall(): void
{
}
public static function pluginUninstall(): void
{
}
}WebPlatesEvent::onWebPlateCreated()
Docblock: array plate data.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | webplate | $webplate | arrayfrom docblock |
When it fires (1 site)
createviaemitPluginEvent()
$event->on(WebPlatesEvent::onWebPlateCreated(), function ($webplate): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:web_plates:plate:created ' . json_encode(['webplate' => $webplate]));
});WebPlatesEvent::onWebPlateDeleted()
Docblock: int plate id, array plate data. (the emitter passes 1 value, see the table)
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | webplate_id | $webplateId | int |
When it fires (1 site)
deleteviaemitPluginEvent()
$event->on(WebPlatesEvent::onWebPlateDeleted(), function ($webplateId): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:web_plates:plate:deleted ' . json_encode(['webplate_id' => $webplateId]));
});WebPlatesEvent::onWebPlateUpdated()
Docblock: int plate id, array plate data.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | webplate_id | $webplateId | int |
| 2 | webplate | $webplate | arrayfrom docblock |
When it fires (1 site)
updateviaemitPluginEvent()
$event->on(WebPlatesEvent::onWebPlateUpdated(), function ($webplateId, $webplate): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:admin:web_plates:plate:updated ' . json_encode(['webplate_id' => $webplateId, 'webplate' => $webplate]));
});