You are here

protected function EntityPager::getCount in Entity Pager 8

Same name and namespace in other branches
  1. 2.0.x src/EntityPager.php \Drupal\entity_pager\EntityPager::getCount()

Returns a render array for a count of all items.

Return value

array The render array for the item count.

1 call to EntityPager::getCount()
EntityPager::getLinks in src/EntityPager.php
Gets an array of entity pager link render arrays.

File

src/EntityPager.php, line 247

Class

EntityPager
Entity pager object.

Namespace

Drupal\entity_pager

Code

protected function getCount() {
  $count = [];
  if ($this->options['display_count']) {
    $current = $this
      ->getCurrentRow();
    $count = [
      '#type' => 'markup',
      '#markup' => $this
        ->t('@cnt of <span class="total">@count</span>', [
        '@cnt' => number_format($current + 1),
        '@count' => number_format($this->view->total_rows),
      ]),
    ];
  }
  return $count;
}