PHP Класс Piwik\Settings\FieldConfig

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$availableValues null | array If supplied, this field should be an array mapping available values with their prettified display value. Eg, if set to array('nb_visits' => 'Visits', 'nb_actions' => 'Actions'), the UI will display **Visits** and **Actions**, and when the user selects one, Piwik will set the setting to **nb_visits** or **nb_actions** respectively. The setting value will be validated if this field is set. If the value is not one of the available values, an error will be triggered. _Note: If a custom validator is supplied (see {@link $validate}), the setting value will not be validated._
$condition string For example 'sitesearch', or 'sitesearch && !use_sitesearch_default' where 'sitesearch' and 'use_sitesearch_default' are both values of fields.
$description null | string Text that will appear directly underneath the setting title in the _Plugin Settings_ admin page. If set, should be a short description of the setting.
$inlineHelp null | string Be sure to escape any user input as HTML can be used here.
$introduction null | string Text that will appear above this setting's section in the _Plugin Settings_ admin page.
$title string Be sure to escape any user input as HTML can be used here.
$transform null | Closure _Note: If a transform is supplied, the setting's {@link $type} has no effect. This means the transformation function will be responsible for casting the setting value to the appropriate data type._ **Example** $setting->transform = function ($value, Setting $setting) { if ($value > 30) { $value = 30; } return (int) $value; }
$uiControl string See {@link Piwik\Plugin\Settings} for a list of supported control types.
$uiControlAttributes array Name-value mapping of HTML attributes that will be added HTML form control, eg, array('size' => 3). Attributes will be escaped before outputting.
$validate null | Closure The closure should take two arguments: the setting value and the {@link Setting} instance being validated. If the value is found to be invalid, the closure should throw an exception with a message that describes the error. **Example** $setting->validate = function ($value, Setting $setting) { if ($value > 60) { throw new \Exception('The time limit is not allowed to be greater than 60 minutes.'); } }

Описание свойств

$availableValues публичное свойство

If supplied, this field should be an array mapping available values with their prettified display value. Eg, if set to array('nb_visits' => 'Visits', 'nb_actions' => 'Actions'), the UI will display **Visits** and **Actions**, and when the user selects one, Piwik will set the setting to **nb_visits** or **nb_actions** respectively. The setting value will be validated if this field is set. If the value is not one of the available values, an error will be triggered. _Note: If a custom validator is supplied (see {@link $validate}), the setting value will not be validated._
public null|array $availableValues
Результат null | array

$condition публичное свойство

For example 'sitesearch', or 'sitesearch && !use_sitesearch_default' where 'sitesearch' and 'use_sitesearch_default' are both values of fields.
public string $condition
Результат string

$description публичное свойство

Text that will appear directly underneath the setting title in the _Plugin Settings_ admin page. If set, should be a short description of the setting.
public null|string $description
Результат null | string

$inlineHelp публичное свойство

Be sure to escape any user input as HTML can be used here.
public null|string $inlineHelp
Результат null | string

$introduction публичное свойство

Text that will appear above this setting's section in the _Plugin Settings_ admin page.
public null|string $introduction
Результат null | string

$title публичное свойство

Be sure to escape any user input as HTML can be used here.
public string $title
Результат string

$transform публичное свойство

_Note: If a transform is supplied, the setting's {@link $type} has no effect. This means the transformation function will be responsible for casting the setting value to the appropriate data type._ **Example** $setting->transform = function ($value, Setting $setting) { if ($value > 30) { $value = 30; } return (int) $value; }
public null|Closure $transform
Результат null | Closure

$uiControl публичное свойство

See {@link Piwik\Plugin\Settings} for a list of supported control types.
public string $uiControl
Результат string

$uiControlAttributes публичное свойство

Name-value mapping of HTML attributes that will be added HTML form control, eg, array('size' => 3). Attributes will be escaped before outputting.
public array $uiControlAttributes
Результат array

$validate публичное свойство

The closure should take two arguments: the setting value and the {@link Setting} instance being validated. If the value is found to be invalid, the closure should throw an exception with a message that describes the error. **Example** $setting->validate = function ($value, Setting $setting) { if ($value > 60) { throw new \Exception('The time limit is not allowed to be greater than 60 minutes.'); } }
public null|Closure $validate
Результат null | Closure