Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Pager.php

function Pager::setTotalPages

Sets the total number of pages.

Parameters

int $totalItems: The total number of items.

int $limit: The maximum number of items per page.

1 call to Pager::setTotalPages()
Pager::__construct in core/lib/Drupal/Core/Pager/Pager.php
Pager constructor.

File

core/lib/Drupal/Core/Pager/Pager.php, line 77

Class

Pager
A value object that represents a pager.

Namespace

Drupal\Core\Pager

Code

protected function setTotalPages($totalItems, $limit) {
    $this->totalPages = (int) ceil($totalItems / $limit);
}
RSS feed
Powered by Drupal