文件名称:php-paginator分页处理类.zip
文件大小:123KB
文件格式:ZIP
更新时间:2022-07-31 04:28:31
类库下载-php-paginator分页处理类
<?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记录页。
【文件预览】:
php-paginator分页处理类
----src()
--------JasonGrimes()
----phpunit.xml.dist(556B)
----php中文网下载站.url(114B)
----examples()
--------screenshot-default-mid.png(15KB)
--------screenshot-default-first.png(12KB)
--------pagerSmall.phtml(2KB)
--------screenshot-small-last.png(9KB)
--------pager.twig(665B)
--------screenshot-small-first.png(8KB)
--------screenshot-small-mid.png(11KB)
--------screenshot-small-mid-open.png(45KB)
--------pagerSmall.twig(2KB)
--------screenshot-default-last.png(14KB)
--------pager.phtml(883B)
----.travis.yml(161B)
----LICENSE(1KB)
----README.md(7KB)
----php中文网免费下载站.txt(219B)
----tests()
--------JasonGrimes()
----.gitignore(38B)
----composer.json(830B)