Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2015-06-17 (1 year ago) | | Not yet rated by the users | | Total: 224 | | All time: 7,630 This week: 1,042 |
|
Description | | Author |
This package can get pagination links for listings split in pages.
It takes as parameters the total number of entries in a listing, the limit of entries to show per page, and the number of the current page.
The class can generate an array with the list of all pages to be displayed in the pagination listing.
Separate classes can format the pagination listing as HTML with links that the user can click to between the different pages of the listing. A special subclass is dedicated to use Bootstrap CSS styles. | |
|
|
Innovation award
Nominee: 1x |
|
Details
Pagination
Lightweight and easy to use pagination library
Install
Via Composer
$ composer require masnathan/pagination
Usage
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.
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email andre.r.flip@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.