Skip to content
PHP Ecosystem
Explore

PageWindow

API reference › Yii3 Debug › Web › PageWindow

final readonly classYii3\Debug\Web\PageWindow
Sourcesrc/Web/PageWindow.php

Resolves the bounded slice of an already filtered and ordered collection and builds the paginator exposing it.

PropertyTypeDescriptionDefined by
$limit readonlypositive-intMaximum number of rows exposed on the resolved page.PageWindow
$offset readonlyintIndex of the first row on the resolved page.PageWindow
$page readonlypositive-intOne-based resolved page number, clamped to the available pages.PageWindow
$pageCount readonlyintTotal number of pages the collection spans.PageWindow
MethodDescriptionDefined by
__construct()Creates a bounded pagination window from raw query values and the collection size.PageWindow
paginate() staticBuilds the paginator positioned on the page the query values select.PageWindow
public function __construct(int $total, string|null $perPage, string|null $page)

Creates a bounded pagination window from raw query values and the collection size.

Parameters

ParameterTypeDescription
$totalintRows in the collection.
$perPagestring|nullRaw per-page query value, or null to keep every row on one page.
$pagestring|nullRaw page query value, or null to start on the first page.
public static function paginate(list<Yii3\Debug\Web\TRow> $rows, string|null $perPage, string|null $page): Yiisoft\Data\Paginator\OffsetPaginator<int, Yii3\Debug\Web\TRow>

Builds the paginator positioned on the page the query values select.

Parameters

ParameterTypeDescription
$rowslist<Yii3\Debug\Web\TRow>Rows already filtered and ordered.
$perPagestring|nullRaw per-page query value, or null to keep every row on one page.
$pagestring|nullRaw page query value, or null to start on the first page.

Returns

Yiisoft\Data\Paginator\OffsetPaginator<int, Yii3\Debug\Web\TRow>: Paginator clamped to the resolved page.