function StringFormatter::settingsSummary

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/StringFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\StringFormatter::settingsSummary()
  2. 8.9.x core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/StringFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\StringFormatter::settingsSummary()
  3. 11.x core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/StringFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\StringFormatter::settingsSummary()

Overrides FormatterBase::settingsSummary

1 call to StringFormatter::settingsSummary()
LanguageFormatter::settingsSummary in core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/LanguageFormatter.php
Returns a short summary for the current formatter settings.
1 method overrides StringFormatter::settingsSummary()
LanguageFormatter::settingsSummary in core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/LanguageFormatter.php
Returns a short summary for the current formatter settings.

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/StringFormatter.php, line 109

Class

StringFormatter
Plugin implementation of the 'string' formatter.

Namespace

Drupal\Core\Field\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  if ($this->getSetting('link_to_entity')) {
    $entity_type = $this->entityTypeManager
      ->getDefinition($this->fieldDefinition
      ->getTargetEntityTypeId());
    if ($entity_type->hasLinkTemplate('canonical')) {
      $summary[] = $this->t('Linked to the @entity_label', [
        '@entity_label' => $entity_type->getLabel(),
      ]);
    }
  }
  return $summary;
}

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