ecommit / paginator
Create a paginator.
Installs: 12 115
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: ^8.0
- symfony/options-resolver: ^5.4|^6.4|^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-10-21 18:10:18 UTC
README
Create a paginator.
Installation
To install paginator with Composer just run :
$ composer require ecommit/paginator
Usage
use Ecommit\Paginator\ArrayPaginator; //Create a paginator $paginator = new ArrayPaginator([ //Options 'page' => 1, 'max_per_page' => 100, 'data' => ['val1', 'val2', 'val3'], //Or with an ArrayIterator //'data' => new \ArrayIterator(['val1', 'val2', 'val3']), ]); $totalPages = $paginator->getLastPage(); $countRows = \count($paginator); foreach ($paginator as $result) { //... }
Available options
Available methods
License
This librairy is under the MIT license. See the complete license in LICENSE file.