PluginUiEvent events
7 FeatherPanel plugin events on PluginUiEvent (7 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 PluginUiEvent 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\PluginUiEvent;
class MyPlugin implements AppPlugin
{
public static function processEvents(PluginEvents $event): void
{
$event->on(PluginUiEvent::onUiError(), function ($source, $message, $context): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:system:plugins:ui:error ' . json_encode(['source' => $source, 'message' => $message, 'context' => $context]));
});
}
public static function pluginInstall(): void
{
}
public static function pluginUninstall(): void
{
}
}PluginUiEvent::onUiError()
Docblock: string source, string message, array context metadata.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | source | $source | string |
| 2 | message | $message | stringfrom docblock |
| 3 | context | $context | array |
When it fires (4 sites)
$event->on(PluginUiEvent::onUiError(), function ($source, $message, $context): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:system:plugins:ui:error ' . json_encode(['source' => $source, 'message' => $message, 'context' => $context]));
});PluginUiEvent::onOverridesRetrieved()
Docblock: array overrides from Frontend/overrides.json aggregations. (the emitter passes 3 values, see the table)
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | hide | $hide | array |
| 2 | replace | $replace | array |
| 3 | actions | $actions | array |
When it fires (1 site)
$event->on(PluginUiEvent::onOverridesRetrieved(), function ($hide, $replace, $actions): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:system:plugins:ui:overrides:retrieved ' . json_encode(['hide' => $hide, 'replace' => $replace, 'actions' => $actions]));
});PluginUiEvent::onUiPacksRetrieved()
Docblock: array UI packs from Frontend/ui.json aggregations.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | packs | $packs | array |
When it fires (1 site)
$event->on(PluginUiEvent::onUiPacksRetrieved(), function ($packs): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:system:plugins:ui:packs:retrieved ' . json_encode(['packs' => $packs]));
});PluginUiEvent::onPublicPagesRetrieved()
Docblock: array public pages from Frontend/public.json aggregations.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | pages | $pages | arrayfrom docblock |
When it fires (1 site)
$event->on(PluginUiEvent::onPublicPagesRetrieved(), function ($pages): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:system:plugins:ui:public-pages:retrieved ' . json_encode(['pages' => $pages]));
});PluginUiEvent::onSidebarRetrieved()
Docblock: array sidebar sections, array context metadata.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | sidebar | $sidebar | array |
| 2 | context | $context | array |
When it fires (1 site)
$event->on(PluginUiEvent::onSidebarRetrieved(), function ($sidebar, $context): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:system:plugins:ui:sidebar:retrieved ' . json_encode(['sidebar' => $sidebar, 'context' => $context]));
});PluginUiEvent::onThemesRetrieved()
Docblock: array themes from Frontend/theme.json aggregations.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | themes | $themes | array |
When it fires (1 site)
$event->on(PluginUiEvent::onThemesRetrieved(), function ($themes): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:system:plugins:ui:themes:retrieved ' . json_encode(['themes' => $themes]));
});PluginUiEvent::onWidgetsRetrieved()
Docblock: array widgets by page/location, array context metadata.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | widgets | $widgets | arrayfrom docblock |
| 2 | context | $context | array |
When it fires (1 site)
$event->on(PluginUiEvent::onWidgetsRetrieved(), function ($widgets, $context): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:system:plugins:ui:widgets:retrieved ' . json_encode(['widgets' => $widgets, 'context' => $context]));
});