lipichang / pagination
分页,提供分页总数,分页参数自动分割,有默认样式可以参考也可以自己定义
dev-master
2022-01-12 03:00 UTC
Requires
- php: >=5.3.0
Requires (Dev)
- php: >=5.4.0
This package is auto-updated.
Last update: 2025-04-12 10:06:54 UTC
README
数组分页,可定制样式,内置3种样式,稍微修改一下可使用与所有的情形下的数组分页
Installation
Pagination is available on Packagist.Just add this line to your composer.json
file:
"lipichang/pagination": "dev-master"
or run
composer require lipichang/pagination:dev-master
Example
use Lipichang\Pagination; $pagination = new Pagination($totalPage,['style' => 1,'is_style' => true,'is_follow' => true,'simple'=>false,'allCounts'=>true,'nowAllPage'=>true,'toPage'=>true],['title' => 'shoes']); //分页样式的渲染 $page = $pagination->render();
Explanation
参数 | 类型 | 说明 |
---|---|---|
totalPage | int | 总页数 |
style | int | 分页样式,可选值1,2,3 |
is_style | boolean | 是否使用默认样式true是 false否 默认true |
is_follow | boolean | 是否允许搜索引擎跟踪 true 是 false 否 默认true |
simple | boolean | true:简单的分页样式,false:复杂的分页样式 |
allCounts | boolean | 显示总页数 |
nowAllPage | boolean | 显示现在的页码 |
toPage | boolean | 跳转页码的功能 |
query | array | 分页其他查询参数 |