当前位置: 旋风说(旋风PHPer分享网)> 资源下载>
类库简介:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | <?php namespace JasonGrimes; class Paginator { const NUM_PLACEHOLDER = '(:num)' ; protected $totalItems ; protected $numPages ; protected $itemsPerPage ; protected $currentPage ; protected $urlPattern ; protected $maxPagesToShow = 10; protected $previousText = 'Previous' ; protected $nextText = 'Next' ; /** * @param int $totalItems The total number of items. * @param int $itemsPerPage The number of items per page. * @param int $currentPage The current page number. * @param string $urlPattern A URL for each page, with (:num) as a placeholder for the page number. Ex. '/foo/page/(:num)' */ public function __construct( $totalItems , $itemsPerPage , $currentPage , $urlPattern = '' ) { $this ->totalItems = $totalItems ; $this ->itemsPerPage = $itemsPerPage ; $this ->currentPage = $currentPage ; $this ->urlPattern = $urlPattern ; $this ->updateNumPages(); } |
函数1:根据总页数,当前页,和页分组及url产生分页导航,分页函数参数列表(有多少页,当前页,每页多少个 ,链接地址)。函数2:根据记录数,页列清数,$page,当前页;$row_num记录总数;$pagesize:每页记录数;$url记录页。
当您发现内容错误或代码bug,以及下载链接无法使用等,请点击屏幕右下角的上报错误来进行提交,我们会尽快修正。
本程序所有源码和工具完全免费,当本网站内容如果侵犯了您的权益,请联系我们,我们会尽快处理,感谢您的合作。
评论:
文明上网理性发言,请遵守 新闻评论服务协议