phprookiehbb / pagination
适用于所有程序的数组分页,内置分页样式,可定制样式,稍微修改一下可使用与所有的情形下的数组分页
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Installs: 428
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/phprookiehbb/pagination
Requires
- php: >=5.3.0
Requires (Dev)
- php: >=5.4.0
This package is auto-updated.
Last update: 2021-10-22 08:28:14 UTC
README
数组分页,可定制样式,内置3种样式,稍微修改一下可使用与所有的情形下的数组分页
Installation
Pagination is available on Packagist.Just add this line to your composer.json file:
"phprookiehbb/pagination": "dev-master"
or run
composer require phprookiehbb/pagination:dev-master
Example
use Crasphb\Pagination; $pagination = new Pagination($target,1,['style' => 1,'simple'=>false,'allCounts'=>true,'nowAllPage'=>true,'toPage'=>true]); //数组的分页后的元素 $item = $pagination->getItem(); //分页样式的渲染 $page = $pagination->render();
Explanation
| 参数 | 类型 | 说明 | 
|---|---|---|
| target | array | 需要分页的数组 | 
| defaultPageSize | int | 每页的数目 | 
| style | int | 分页样式,可选值1,2,3 | 
| simple | boolean | true:简单的分页样式,false:复杂的分页样式 | 
| allCounts | boolean | 显示总页数 | 
| nowAllPage | boolean | 显示现在的页码 | 
| toPage | boolean | 跳转页码的功能 |