适用于所有情况的数组分页

浏览:578 发布日期:2019/05/22 分类:技术分享
之前写了个关于tp5的数组分页,详情可见https://crasphter.cn/article/16https://crasphter.cn/article/15,没想到这两篇是我博客中访问量最大的,所有就升级了一下,不单单是tp5,使之适用于所有的情况的数组分页。

安装方式
在composer.json中添加"phprookiehbb/pagination": "dev-master"或者composer require phprookiehbb/pagination:dev-master使用方式use Crasphb\Pagination;
$pagination = new Pagination($target,1,['style' => 1,'simple'=>false,'allCounts'=>true,'nowAllPage'=>true,'toPage'=>true]);
//数组的分页后的元素
$item = $pagination->getItem();
//分页样式的渲染
$page = $pagination->render();
参数解释

simple模式

style = 1,2,3

allCount,nowAllPage,toPage模式


内容详见博客https://crasphter.cn/article/38
github地址https://github.com/phprookiehbb/Pagination,欢迎大家star
最佳答案
评论( 相关
后面还有条评论,点击查看>>