Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-11T07:24:09.000Z (over 3 years ago)
- Last Synced: 2024-10-13T13:20:52.607Z (2 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
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/teodoroleckie/paginator/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/teodoroleckie/paginator/?branch=main)
[![Build Status](https://scrutinizer-ci.com/g/teodoroleckie/paginator/badges/build.png?b=main)](https://scrutinizer-ci.com/g/teodoroleckie/paginator/build-status/main)
[![Total Downloads](https://img.shields.io/packagist/dt/tleckie/paginator.svg?style=flat-square)](https://packagist.org/packages/tleckie/paginator)
[![Code Intelligence Status](https://scrutinizer-ci.com/g/teodoroleckie/paginator/badges/code-intelligence.svg?b=main)](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;
```