https://github.com/pollen-solutions/pagination
Pollen Solutions - Pagination Component - Layer and utilities to paginate items in web applications
https://github.com/pollen-solutions/pagination
php
Last synced: about 14 hours ago
JSON representation
Pollen Solutions - Pagination Component - Layer and utilities to paginate items in web applications
- Host: GitHub
- URL: https://github.com/pollen-solutions/pagination
- Owner: pollen-solutions
- License: mit
- Created: 2021-08-11T10:51:24.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-12T07:03:24.000Z (almost 4 years ago)
- Last Synced: 2025-01-14T11:58:17.653Z (6 months ago)
- Topics: php
- Language: PHP
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Pagination Component
[](https://packagist.org/packages/pollen-solutions/pagination)
[](LICENSE.md)
[](https://www.php.net/supported-versions.php)Pollen Solutions **Pagination** Component provides layer and utilities to paginate items in web applications.
It provides an adapter for Wordpress application.## Installation
```bash
composer require pollen-solutions/pagination
```## Basic Usage
```php
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```php
use Pollen\Pagination\PaginationManager;add_action('wp', function () {
echo new PaginationManager();
exit;
});
```## Through a controller
```php
```