PaginationComponent
final class PaginationComponent (View source)
Provides the application-facing entry point for creating and rendering pagination.
Methods
Initializes the component with the request-aware factory and shared renderer.
Paginates in-memory rows using an explicit page or the current request's page parameter.
Paginates database rows using an explicit page or the current request's page parameter.
Renders a pagination result or state, returning an empty string when no state is supplied.
Details
__construct
__construct(PaginationFactory $factory, PaginationRenderer $renderer)
Initializes the component with the request-aware factory and shared renderer.
fromArray
PaginationResult
fromArray(array $items, int|null $page = null, int|null $perPage = null, string $pageName = 'page', string|null $basePath = null, array|null $query = null)
Paginates in-memory rows using an explicit page or the current request's page parameter.
fromQueryBuilder
PaginationResult
fromQueryBuilder(QueryBuilder $builder, int|null $page = null, int|null $perPage = null, string $pageName = 'page', string|null $basePath = null, array|null $query = null)
Paginates database rows using an explicit page or the current request's page parameter.
render
string
render(PaginationResult|PaginationState|null $pagination)
Renders a pagination result or state, returning an empty string when no state is supplied.