You are here

public function StringTextfieldWidget::settingsSummary in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php \Drupal\Core\Field\Plugin\Field\FieldWidget\StringTextfieldWidget::settingsSummary()

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

core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php, line 60
Contains \Drupal\Core\Field\Plugin\Field\FieldWidget\StringTextfieldWidget.

Class

StringTextfieldWidget
Plugin implementation of the 'string_textfield' widget.

Namespace

Drupal\Core\Field\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = array();
  $summary[] = t('Textfield size: @size', array(
    '@size' => $this
      ->getSetting('size'),
  ));
  $placeholder = $this
    ->getSetting('placeholder');
  if (!empty($placeholder)) {
    $summary[] = t('Placeholder: @placeholder', array(
      '@placeholder' => $placeholder,
    ));
  }
  return $summary;
}