View .md

PluginsSettingsEvent events

2 FeatherPanel plugin events on PluginsSettingsEvent (2 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 PluginsSettingsEvent 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\PluginsSettingsEvent;

class MyPlugin implements AppPlugin
{
    public static function processEvents(PluginEvents $event): void
    {
        $event->on(PluginsSettingsEvent::onPluginSettingDelete(), function ($identifier, $key): void {
            App::getInstance(true)->getLogger()->info('[myplugin] plugins:settings:delete ' . json_encode(['identifier' => $identifier]));
        });
    }

    public static function pluginInstall(): void
    {
    }

    public static function pluginUninstall(): void
    {
    }
}

PluginsSettingsEvent::onPluginSettingDelete()

Name: plugins:settings:deleteemitted at 1 siteCancel or modify: nodefinition
#Payload keyListener parameterType
1identifier$identifierstring
2key$keynot declared
When it fires (1 site)
$event->on(PluginsSettingsEvent::onPluginSettingDelete(), function ($identifier, $key): void {
    App::getInstance(true)->getLogger()->info('[myplugin] plugins:settings:delete ' . json_encode(['identifier' => $identifier]));
});

PluginsSettingsEvent::onPluginSettingUpdate()

Name: plugins:settings:updateemitted at 1 siteCancel or modify: nodefinition
#Payload keyListener parameterType
1identifier$identifierstring
2key$keynot declared
3value$valuebool
When it fires (1 site)
$event->on(PluginsSettingsEvent::onPluginSettingUpdate(), function ($identifier, $key, $value): void {
    App::getInstance(true)->getLogger()->info('[myplugin] plugins:settings:update ' . json_encode(['identifier' => $identifier, 'value' => $value]));
});