You are here

public function ShowMore::getPagerTotal in Views Show More 8

Render overwrite.

Overrides SqlBase::getPagerTotal

File

src/Plugin/views/pager/ShowMore.php, line 311

Class

ShowMore
The plugin to handle show more pager.

Namespace

Drupal\views_show_more\Plugin\views\pager

Code

public function getPagerTotal() {
  if ($items_per_page = intval($this
    ->getItemsPerPage())) {
    if ($initial_items = intval($this
      ->getInitial())) {
      return 1 + ceil(($this->total_items - $initial_items) / $items_per_page);
    }
    else {
      return ceil($this->total_items / $items_per_page);
    }
  }
  else {
    return 1;
  }
}