function CommentDefaultFormatter::settingsSummary

Same name in other branches
  1. 9 core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php \Drupal\comment\Plugin\Field\FieldFormatter\CommentDefaultFormatter::settingsSummary()
  2. 8.9.x core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php \Drupal\comment\Plugin\Field\FieldFormatter\CommentDefaultFormatter::settingsSummary()
  3. 11.x core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php \Drupal\comment\Plugin\Field\FieldFormatter\CommentDefaultFormatter::settingsSummary()

Overrides FormatterBase::settingsSummary

File

core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php, line 248

Class

CommentDefaultFormatter
Provides a default comment formatter.

Namespace

Drupal\comment\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
    $view_mode = $this->getSetting('view_mode');
    $view_modes = $this->getViewModes();
    $view_mode_label = $view_modes[$view_mode] ?? 'default';
    $summary = [
        $this->t('Comment view mode: @mode', [
            '@mode' => $view_mode_label,
        ]),
    ];
    if ($pager_id = $this->getSetting('pager_id')) {
        $summary[] = $this->t('Pager ID: @id', [
            '@id' => $pager_id,
        ]);
    }
    return $summary;
}

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