Skip to content
PHP Ecosystem
Explore

PageSize

API reference › Debug Core › Data › PageSize

final classPHPForge\Debug\Data\PageSize
Sourcesrc/Data/PageSize.php

Resolves the per-page grid page size and renders the shared page-size selector.

MethodDescriptionDefined by
current() staticReturns the per-page selector state, canonicalizing all and falling back to the default.PageSize
resolve() staticResolves the raw per-page value into an effective page size.PageSize
selectorFor() staticRenders the page-size selector for the per-page value found in the query parameters.PageSize
ConstantValueDescriptionDefined by
ALL'all'Selector value that disables pagination.PageSize
DEFAULT50Default page size applied when no per-page parameter is supplied or the value is invalid.PageSize
MAX1000Hard cap on the number of rows per page.PageSize
OPTIONS['10', '25', '50', '100', self::ALL]Selector options in display order; the literal all disables pagination.PageSize
public static function current(string|null $raw, int $default = \self::DEFAULT): string

Returns the per-page selector state, canonicalizing all and falling back to the default.

Parameters

ParameterTypeDescription
$rawstring|nullRaw per-page query-parameter value, or null when absent.
$defaultintPage size used when no value is supplied.

Returns

string: Canonical selector value: ALL, the raw value, or the default as a string.

public static function resolve(string|null $raw, positive-int $default = \self::DEFAULT): positive-int|null

Resolves the raw per-page value into an effective page size.

Parameters

ParameterTypeDescription
$rawstring|nullRaw per-page query-parameter value, or null when absent.
$defaultpositive-intPage 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.

public static function selectorFor(array<array-key, mixed> $queryParams): string

Renders the page-size selector for the per-page value found in the query parameters.

Parameters

ParameterTypeDescription
$queryParamsarray<array-key, mixed>Query parameters already normalized by the panel.

Returns

string: Rendered selector markup.