ecommit/paginator
最新稳定版本:v1.3.0
Composer 安装命令:
composer require ecommit/paginator
包简介
Create a paginator.
关键字:
README 文档
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
| Option | Type | Required | Default value | Description |
|---|---|---|---|---|
| page | Integer | No | 1 | Current page |
| max_per_page | Integer | No | 100 | Max elements per page |
| data | Array or ArrayIterator | Yes |
|
|
| count | Integer or null | No | Null | You can use this option when the data volume is too large. If the value is not null :
|
Available methods
License
This librairy is under the MIT license. See the complete license in LICENSE file.
统计信息
- 总下载量: 17.32k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-08-21