protected function InfiniteScroll::getRemainingNumberItems in Views Infinite Scroll 8
Returns the number of items remaining over the next pages.
Return value
int The number of items over the remaining pages.
1 call to InfiniteScroll::getRemainingNumberItems()
- InfiniteScroll::render in src/
Plugin/ views/ pager/ InfiniteScroll.php - Return the renderable array of the pager.
File
- src/
Plugin/ views/ pager/ InfiniteScroll.php, line 173
Class
- InfiniteScroll
- Views pager plugin to handle infinite scrolling.
Namespace
Drupal\views_infinite_scroll\Plugin\views\pagerCode
protected function getRemainingNumberItems() {
$items_per_page = (int) $this->view
->getItemsPerPage();
$total = (int) $this
->getTotalItems();
$current_page = (int) $this
->getCurrentPage() + 1;
return $total - $current_page * $items_per_page;
}