PageWindow
API reference › Yii3 Debug › Web › PageWindow
Resolves the bounded slice of an already filtered and ordered collection and builds the paginator exposing it.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$limit readonly | positive-int | Maximum number of rows exposed on the resolved page. | PageWindow |
$offset readonly | int | Index of the first row on the resolved page. | PageWindow |
$page readonly | positive-int | One-based resolved page number, clamped to the available pages. | PageWindow |
$pageCount readonly | int | Total number of pages the collection spans. | PageWindow |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a bounded pagination window from raw query values and the collection size. | PageWindow |
paginate() static | Builds the paginator positioned on the page the query values select. | PageWindow |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”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
| Parameter | Type | Description |
|---|---|---|
$total | int | Rows in the collection. |
$perPage | string| | Raw per-page query value, or null to keep every row on one page. |
$page | string| | Raw page query value, or null to start on the first page. |
paginate()
Section titled “paginate() ”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
| Parameter | Type | Description |
|---|---|---|
$rows | list<Yii3\ | Rows already filtered and ordered. |
$perPage | string| | Raw per-page query value, or null to keep every row on one page. |
$page | string| | Raw 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.