<?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(); }
函數(shù)1:根據(jù)總頁(yè)數(shù),當(dāng)前頁(yè),和頁(yè)分組及url產(chǎn)生分頁(yè)導(dǎo)航,分頁(yè)函數(shù)參數(shù)列表(有多少頁(yè),當(dāng)前頁(yè),每頁(yè)多少個(gè)?,鏈接地址)。函數(shù)2:依記錄數(shù),頁(yè)列清數(shù),$page,目前頁(yè);$row_num記錄總數(shù);$pagesize:每頁(yè)記錄數(shù);$url記錄頁(yè)。
本站所有資源皆由網(wǎng)友貢獻(xiàn)或各大下載網(wǎng)站轉(zhuǎn)載。請(qǐng)自行檢查軟體的完整性!本站所有資源僅供學(xué)習(xí)參考。請(qǐng)不要將它們用於商業(yè)目的。否則,一切後果都由您負(fù)責(zé)!如有侵權(quán),請(qǐng)聯(lián)絡(luò)我們刪除。聯(lián)絡(luò)方式:admin@php.cn
相關(guān)文章

21 Jul 2016
php oracle 分頁(yè)類(lèi)別。 example.php 複製程式碼如下: ?php $conn = ociplogon("test","123456","test123"); include_once "pager.inc.php"; ? 複製程式碼如下: ?php /** 分頁(yè)測(cè)試開(kāi)始*/ /

21 Jul 2016
實(shí)現(xiàn)分十頁(yè)分向前十頁(yè)向後十頁(yè)的處理。 ?/*====對(duì)資料的記錄進(jìn)行分頁(yè)顯示 ===== 一張頁(yè)面有連續(xù)的十個(gè)頁(yè)面的連接一頁(yè)可顯示$limit_row筆記錄資訊並有下十頁(yè)和上十頁(yè)翻頁(yè)功能====


熱門(mén)工具標(biāo)籤

熱工具

一款萬(wàn)能的PHP分頁(yè)類(lèi)
一款萬(wàn)能的PHP分頁(yè)類(lèi)別實(shí)例程式碼

php 萬(wàn)能分頁(yè)類(lèi)
php 萬(wàn)能分頁(yè)類(lèi)

php的一個(gè)分頁(yè)類(lèi)
php的一個(gè)分頁(yè)類(lèi)
