PHP Класс Piwik\Settings\Plugin\UserSettings
Descendants of this class should implement the {@link init()} method and call the
{@link addSetting()} method for each of the plugin's settings.
For an example, see {@link Piwik\Plugins\ExampleSettingsPlugin\UserSettings}.
$userSettings = new Piwik\Plugins\ExampleSettingsPlugin\UserSettings(); // get instance via dependency injection
$userSettings->yourSetting->getValue();
Показать файл
Открыть проект
Примеры использования класса
Открытые методы
Метод |
Описание |
|
__construct ( ) |
Constructor. |
|
save ( ) |
Saves (persists) the current setting values in the database. |
|
Защищенные методы
Метод |
Описание |
|
makeSetting ( string $name, mixed $defaultValue, string $type, $configureCallback ) : UserSetting |
Creates a new user setting. |
|
Описание методов
__construct()
публичный Метод
makeSetting()
защищенный Метод
Settings will be displayed in the UI depending on the order of makeSetting calls. This means you can define
the order of the displayed settings by calling makeSetting first for more important settings.
protected makeSetting ( string $name, mixed $defaultValue, string $type, $configureCallback ) : UserSetting |
$name |
string |
The name of the setting that shall be created |
$defaultValue |
mixed |
The default value for this setting. Note the value will not be converted to the
specified type. |
$type |
string |
The PHP internal type the value of this setting should have.
Use one of FieldConfig::TYPE_* constancts |
Результат |
UserSetting |
Returns an instance of the created measurable setting. |
Will trigger an event to notify plugins that a value has been changed.