function TelephoneDefaultWidget::settingsSummary

Same name in other branches
  1. 9 core/modules/telephone/src/Plugin/Field/FieldWidget/TelephoneDefaultWidget.php \Drupal\telephone\Plugin\Field\FieldWidget\TelephoneDefaultWidget::settingsSummary()
  2. 10 core/modules/telephone/src/Plugin/Field/FieldWidget/TelephoneDefaultWidget.php \Drupal\telephone\Plugin\Field\FieldWidget\TelephoneDefaultWidget::settingsSummary()
  3. 11.x core/modules/telephone/src/Plugin/Field/FieldWidget/TelephoneDefaultWidget.php \Drupal\telephone\Plugin\Field\FieldWidget\TelephoneDefaultWidget::settingsSummary()

Overrides WidgetBase::settingsSummary

File

core/modules/telephone/src/Plugin/Field/FieldWidget/TelephoneDefaultWidget.php, line 47

Class

TelephoneDefaultWidget
Plugin implementation of the 'telephone_default' widget.

Namespace

Drupal\telephone\Plugin\Field\FieldWidget

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.