medisolbv / pagination
A simple package to allow easy generation of pagination links
Installs: 157
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/medisolbv/pagination
Requires
- php: ^8.2
Requires (Dev)
- phpstan/phpstan: ^1.12
- phpunit/phpunit: ^11.3
- squizlabs/php_codesniffer: *
This package is not auto-updated.
Last update: 2026-01-10 12:50:15 UTC
README
This is a simple package to generate the correct pagination links.
Usage
A new Paginator object can be instantiated with the Paginator::create method. This method takes two parameters;
int $currentPageint $totalPages.
Generating links
After instantiating a new Paginator object, the generate method can be used to generate the required links.
Getting the links
After generating links, you can use these links by calling the Paginator::getLinks method. When returning the result
in JSON format, the links will be serialized to JSON.
Available link methods
PaginationLink::getPage: returns the link's page numberPaginationLink::isActive: returns whether the current page is this pagePaginationLink::isDisabled: returns whether this page is disabled (for example, the ellipsis between different link ranges).