omerkamcili / pagination
There is no license information available for the latest version (v1.2.0) of this package.
Calculate pages with take, skip and total parameters and then create pagination links
v1.2.0
2020-01-08 13:08 UTC
Requires
- php: ^7.1.3
Requires (Dev)
- phpunit/phpunit: ^8.5
This package is not auto-updated.
Last update: 2025-01-30 13:14:50 UTC
README
Calculate and create urls from take, skip and total parameters for pagination.
Install
Install package with composer
composer install omerkamcili\pagination
Example
$data = [
'total' => 359,
'skip' => 20,
'url' => 'http://www.yourapp.com/currentPage',
];
$pagination = new \OmerKamcili\Pagination\Pagination($data);
print_r($pagination);
foreach($pagination->pages as $page => $url){
echo "Page $page: $url";
}
Parameters
All parameters public, you can access from outside and you can set with construct method
Contributing
You can create merge request or you can create issue card, there is no rules about this.