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

Breadcrumb

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

function Pager::__construct

Pager constructor.

Parameters

int $totalItems: The total number of items.

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

int $currentPage: The current page.

File

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

Class

Pager
A value object that represents a pager.

Namespace

Drupal\Core\Pager

Code

public function __construct($totalItems, $limit, $currentPage = 0) {
    $this->totalItems = $totalItems;
    $this->limit = $limit;
    $this->setTotalPages($totalItems, $limit);
    $this->setCurrentPage($currentPage);
}
RSS feed
Powered by Drupal