Home >php教程 >php手册 >五分页类

五分页类

WBOY
WBOYOriginal
2016-06-13 10:24:37959browse

infoCount = $infoCount; $this->items = $items; $this->pageNo = $pageNo; $this->pageCount = $this->GetPageCount(); $this->AdjustPageNo(); $this->startPos = $this->GetStartPos(); } function AdjustPageNo() { if($this->pageNo == || $this->pageNo pageNo = 1; if ($this->pageNo > $this->pageCount) $this->pageNo = $this->pageCount; } /** * 下一页 */ function GoToNextPage() { $nextPageNo = $this->pageNo + 1; if ($nextPageNo > $this->pageCount) { $this->nextPageNo = $this->pageCount; return false; } $this->nextPageNo = $nextPageNo; return true; } /** * 上一页 */ function GotoPrevPage() { $prevPageNo = $this->pageNo - 1; if ($prevPageNo prevPageNo = 1; return false; } $this->prevPageNo = $prevPageNo; return true; } function GetPageCount() { return ceil($this->infoCount / $this->items); } function GetStartPos() { return ($this->pageNo - 1) * $this->items; } } ?>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:什么是PHPNext article:xzn_html_tree1.0可折叠大纲