public function AssociativeArrayWidget::settingsSummary in Map Widget 8
Returns a short summary for the current widget settings.
If an empty result is returned, a UI can still be provided to display a settings form in case the widget has configurable settings.
Return value
array A short summary of the widget settings.
Overrides WidgetBase::settingsSummary
File
- src/
Plugin/ Field/ FieldWidget/ AssociativeArrayWidget.php, line 65
Class
- AssociativeArrayWidget
- Plugin implementation of the 'map_item_widget' widget.
Namespace
Drupal\map_widget\Plugin\Field\FieldWidgetCode
public function settingsSummary() {
$summary = [];
$summary[] = $this
->t('Key & value input size: @size', [
'@size' => $this
->getSetting('size'),
]);
if (!empty($this
->getSetting('key_placeholder'))) {
$summary[] = $this
->t('Key placeholder: @placeholder', [
'@placeholder' => $this
->getSetting('key_placeholder'),
]);
}
if (!empty($this
->getSetting('value_placeholder'))) {
$summary[] = $this
->t('Value placeholder: @placeholder', [
'@placeholder' => $this
->getSetting('value_placeholder'),
]);
}
return $summary;
}