Lightweight and easy to use pagination library
Via Composer
$ composer require masnathan/pagination
use MASNathan\Pagination\Pagination;
$pager = new Pagination($totalPages, $boundaries, $around, $currentPage);
foreach ($pager->getPages() as $pageLabel) {
echo sprintf('<a href="/list/page/%s">%s</a>', $pageLabel, $pageLabel);
}
You can also check the MASNathan\Pagination\Html\Pagination
for a html builder, it's possible to extend it as well, check the Bootstrap class.
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email andre.r.flip@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.