falgunphp / pagination
Installs: 57
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/falgunphp/pagination
Requires
- php: ^7.4|^8.0
Requires (Dev)
- phpunit/phpunit: ^9.5
- sempro/phpunit-pretty-print: ^1.4
- vimeo/psalm: ^3.18
This package is auto-updated.
Last update: 2025-09-25 04:23:12 UTC
README
Easy to use Pagination for Falgun Framework.
Install
Please not that PHP 7.4 or higher is required.
Via Composer
$ composer require falgunphp/pagination
Basic Usage
<?php use Falgun\Pagination\Pagination; $currentPage = 1; $itemsPerPage = 10; $maxLinkToShow = 5; $pagination = new Pagination($currentPage, $itemsPerPage, $maxLinkToShow); // set total item count we got from db/api $pagination->setTotalItems(1000); $paginationBag = $pagination->make(); // $paginationBag is a instance of Falgun\Pagination\PaginationBag // It has four properties // public Page $firstPage; // public Page $lastPage; // public Page $prePage; // public Page $nextPage; // public Iterator $links; // You have to build your own html pagination from this $paginationBag
License
The MIT License (MIT). Please see License File for more information.