Piwik\Settings\FieldConfig\
Lets you configure a field for a field array.
Usage:
$field->uiControl = FieldConfig::UI_CONTROL_FIELD_ARRAY; $arrayField = new FieldConfig\ArrayField('Index', FieldConfig::UI_CONTROL_TEXT); $field->uiControlAttributes['field'] = $field->toArray();
This class defines the following properties:
$uiControl
— Describes what HTML element should be used to manipulate the setting through Matomo (formerly Piwik)'s UI.$customFieldComponent
— Array like ['plugin' => 'MyPlugin', 'component' => 'MyExportedCustomFieldComponent'].$title
— This setting's display name, for example, 'Refresh Interval'
.$availableValues
— The list of all available values for this setting.$uiControl
Describes what HTML element should be used to manipulate the setting through Matomo's UI.
See Piwik\Plugin\Settings for a list of supported control types.
string
value.$customFieldComponent
Array like ['plugin' => 'MyPlugin', 'component' => 'MyExportedCustomFieldComponent']. For an example see "plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue"
string[]
value.$title
This setting's display name, for example, 'Refresh Interval'
.
Be sure to escape any user input as HTML can be used here.
string
value.$availableValues
The list of all available values for this setting. If null, the setting can have any value.
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, Matomo will
set the setting to nb_visits or nb_actions respectively.
null
array
The class defines the following methods:
__construct()
It accepts the following parameter(s):
$title
$uiControl
toArray()