https://github.com/teodoroleckie/paginator
⚡ Php paginator. Pager library to manage paging
https://github.com/teodoroleckie/paginator
pagination pagintor php php-pagination php8
Last synced: 2 months ago
JSON representation
⚡ Php paginator. Pager library to manage paging
- Host: GitHub
- URL: https://github.com/teodoroleckie/paginator
- Owner: teodoroleckie
- License: mit
- Created: 2021-05-07T07:42:47.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-11T07:24:09.000Z (about 4 years ago)
- Last Synced: 2025-01-19T22:50:56.344Z (4 months ago)
- Topics: pagination, pagintor, php, php-pagination, php8
- Language: PHP
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Php paginator
[](https://scrutinizer-ci.com/g/teodoroleckie/paginator/?branch=main)
[](https://scrutinizer-ci.com/g/teodoroleckie/paginator/build-status/main)
[](https://packagist.org/packages/tleckie/paginator)
[](https://scrutinizer-ci.com/code-intelligence)Enumerator in php
### Installation
You can install the package via composer:
```bash
composer require tleckie/paginator
```### Usage:
```php
getTotalPages();// 10
$paginator->getLastPage(); // 10
$paginator->getOffset(); // 10
$paginator->getPrevPage(); // 1
$paginator->getNextPage(); // 3
$paginator->hasNext(); // true
$paginator->hasPrev(); // true```
### Interface:
```php
PaginatorInterface
```### All methods:
```phppublic function getTotalRecords(): int;
public function getItemsPerPage(): int;
public function getCurrentPage(): int;
public function setCurrentPage(int $currentPage): PaginatorInterface;
public function setTotalRecords(int $totalRecords): PaginatorInterface;
public function setItemsPerPage(int $itemsPerPage): PaginatorInterface;
public function hasPrev(): bool;
public function hasNext(): bool;
public function getNextPage(): int;
public function getPrevPage(): int;
public function getLastPage(): int;
public function getFirstPage(): int;
public function getOffset(): int;
public function getTotalPages(): int;
```