Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 6 days 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 (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-08-12T07:03:24.000Z (over 3 years ago)
- Last Synced: 2024-04-17T11:27:59.763Z (7 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
[![Latest Stable Version](https://img.shields.io/packagist/v/pollen-solutions/pagination.svg?style=for-the-badge)](https://packagist.org/packages/pollen-solutions/pagination)
[![MIT Licensed](https://img.shields.io/badge/license-MIT-green?style=for-the-badge)](LICENSE.md)
[![PHP Supported Versions](https://img.shields.io/badge/PHP->=7.4-8892BF?style=for-the-badge&logo=php)](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
```