You are here

public function Pagerer::summaryTitle in Pagerer 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/pager/Pagerer.php \Drupal\pagerer\Plugin\views\pager\Pagerer::summaryTitle()

Return a string to display as the clickable title for the pager plugin.

Overrides Full::summaryTitle

File

src/Plugin/views/pager/Pagerer.php, line 86

Class

Pagerer
The views plugin to handle Pagerer pager.

Namespace

Drupal\pagerer\Plugin\views\pager

Code

public function summaryTitle() {
  if ($preset = $this->presetStorage
    ->load($this->options['preset'])) {
    $preset_label = $preset
      ->label();
  }
  else {
    $preset_label = $this
      ->t('n/a');
  }
  if (!empty($this->options['offset'])) {
    return $this
      ->formatPlural($this->options['items_per_page'], "Using preset %preset, @count item, skip @skip", "Using preset %preset, @count items, skip @skip", [
      '%preset' => $preset_label,
      '@count' => $this->options['items_per_page'],
      '@skip' => $this->options['offset'],
    ]);
  }
  return $this
    ->formatPlural($this->options['items_per_page'], "Using preset %preset, @count item", "Using preset %preset, @count items", [
    '%preset' => $preset_label,
    '@count' => $this->options['items_per_page'],
  ]);
}