pollen-solutions / pagination
Pollen Solutions - Pagination Component - Layer and utilities to paginate items in web applications
v1.0.1
2021-08-11 00:00 UTC
Requires
- php: ^7.4 || ^8.0
- pollen-solutions/http: ^1.0
- pollen-solutions/partial: ^1.0
- pollen-solutions/support: ^1.0
Requires (Dev)
- phpunit/phpunit: ^9.0
- roave/security-advisories: dev-latest
Suggests
- pollen-solutions/container: Pollen Solutions - Container Component - PSR-11 ready Dependencies Injection Container.
This package is auto-updated.
Last update: 2024-12-12 13:57:02 UTC
README
Pollen Solutions Pagination Component provides layer and utilities to paginate items in web applications. It provides an adapter for Wordpress application.
Installation
composer require pollen-solutions/pagination
Basic Usage
use Pollen\Pagination\PaginationManager; use Pollen\Pagination\Paginator; $pagination = new PaginationManager(); $paginator = new Paginator( [ 'per_page' => 20, 'total' => 60, ] ); var_dump($paginator->toArray()); $pagination->setPaginator($paginator); echo $pagination;
Wordpress Usage
In this example, we consider that the current HTTP request corresponds to a search results page. ex. https://example.com/?s=a
use Pollen\Pagination\PaginationManager; add_action('wp', function () { echo new PaginationManager(); exit; });