PageSize
API reference › Debug Core › Data › PageSize
Resolves the per-page grid page size and renders the shared page-size selector.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
current() static | Returns the per-page selector state, canonicalizing all and falling back to the default. | PageSize |
resolve() static | Resolves the raw per-page value into an effective page size. | PageSize |
selectorFor() static | Renders the page-size selector for the per-page value found in the query parameters. | PageSize |
Constants
Section titled “Constants”| Constant | Value | Description | Defined by |
|---|---|---|---|
ALL | 'all' | Selector value that disables pagination. | PageSize |
DEFAULT | 50 | Default page size applied when no per-page parameter is supplied or the value is invalid. | PageSize |
MAX | 1000 | Hard cap on the number of rows per page. | PageSize |
OPTIONS | ['10', | Selector options in display order; the literal all disables pagination. | PageSize |
Method details
Section titled “Method details”current()
Section titled “current() ”public static function current(string|null $raw, int $default = \self::DEFAULT): stringReturns the per-page selector state, canonicalizing all and falling back to the default.
Parameters
| Parameter | Type | Description |
|---|---|---|
$raw | string| | Raw per-page query-parameter value, or null when absent. |
$default | int | Page size used when no value is supplied. |
Returns
string: Canonical selector value: ALL, the raw value, or the default as a string.
resolve()
Section titled “resolve() ”public static function resolve(string|null $raw, positive-int $default = \self::DEFAULT): positive-int|nullResolves the raw per-page value into an effective page size.
Parameters
| Parameter | Type | Description |
|---|---|---|
$raw | string| | Raw per-page query-parameter value, or null when absent. |
$default | positive-int | Page size used when no value is supplied or the value is invalid. |
Returns
positive-int|null: Effective page size capped at MAX, or null when all disables pagination.
selectorFor()
Section titled “selectorFor() ”public static function selectorFor(array<array-key, mixed> $queryParams): stringRenders the page-size selector for the per-page value found in the query parameters.
Parameters
| Parameter | Type | Description |
|---|---|---|
$queryParams | array<array-key, | Query parameters already normalized by the panel. |
Returns
string: Rendered selector markup.