2022年一个php的分页类-PHP技术-源码之家-源码学院 .pdf

上传人:Che****ry 文档编号:27264830 上传时间:2022-07-23 格式:PDF 页数:10 大小:88.44KB
返回 下载 相关 举报
2022年一个php的分页类-PHP技术-源码之家-源码学院 .pdf_第1页
第1页 / 共10页
2022年一个php的分页类-PHP技术-源码之家-源码学院 .pdf_第2页
第2页 / 共10页
点击查看更多>>
资源描述

《2022年一个php的分页类-PHP技术-源码之家-源码学院 .pdf》由会员分享,可在线阅读,更多相关《2022年一个php的分页类-PHP技术-源码之家-源码学院 .pdf(10页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、?php?3 (o? ? ) - PHP? ? - ? - ?o.txt?D2? ?D ?a ?D|?D o ?e?¥ ? ?o? ?php?3 (o? ? ) - PHP? ? - ? ? - ?o ?2?2a? 1y?2?D? ?o 1 ?Y? ?2?D? ? D? ? ? ?a 3 ? ?2? ? | ASP? ? | PHP? ? | .NET? | JSP? | 1? ?t | ?3? | ?- | t? | y?Y?a | ?t21? | ?2? ?3 ? | ASP? 3 | PHP? 3 | .NET?3 | ?3? | 3D? ? | PHPWind? ? | Discuz!

2、? ? | ? ? ? | PHP168? ? ? | ASP? 3? | ASP? ? | PHP? 3? | PHP ?CMS | PHP? ? | PHP ? 3? | ? ? | ?-? | ? 2? 3 ? 1 ? ?t ? 3 ? 3 D? ? ? ?o ? ?3 ? ?o 3 - ?o - PHP? ? ?php?3 (o? ? ) 2010-08-02 13:54:43 ?:? ? ?3 ? ? ?D D? ? :9 ?setShowPageNum($num); ?3y $pages-setCurrentIndexPage($num); ? ? 3? ?3?D? $pages-

3、setFirstPageText($text); ? ? ?3? $pages-setLastPageText($text); ? ? ?o ?3? $pages-setPrePageText($text); ? ? ?3? $pages-setNextPageText($text); ? ?3? $pages-setPageCss($css); ? ?3?css? ?class?3? $pages-setCurrentPageCss($css); ? ? 3?css? ?class?3? $pages-setPageStyle($style); ? ?3? ?style ?D? $pages

4、-setCurrentPageStyle($style); ? ? 3? ?style ?D? $pages-setLinkSymbol(=); ? ?D3? ?page=2?D?=? $pages-isShowFirstAndLast(true); ? ?3?o ?3? ? $pages-isShowForSimplePage(true); ? ?D?3 ?3 $pageCount = $pages-getTotalPageNum(); ? 3y ? 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - -

5、 - - - 第 1 页,共 10 页 - - - - - - - - - ?php /?3 class Pages private $eachDisNums; /?3?y private $nums; / ?y private $currentPage; / ? ?D?3 private $showPageNum = 5; /?3y private $curIndexPage = 3; / ? 3? ?3?D? private $totalPageNum; / 3y private $arrPage = array(); /? 11? ?3?y private $subPageLink; /

6、?3? ? private $firstPageText = 1.; / ?3? private $lastPageText; /?o ?3? private $prePageText = ; /?3? private $pageCss = ; /?3? ?3? private $curPageCss = ; / ? 3? ?3? private $pageStyle = ; /?3? ? private $curPageStyle = ; / ? 3? ? private $linkSymbol = =; /url ? ?Dpage?3y?o? private $isShowFirstLas

7、t = true; /? ?3o ?o ?3 private $isShowForSimplePage = false; / ?D?3 (? ?y2? ?3?y) ?3? /* * ?3y * * param integer $num ?3y * return void */ public function setShowPageNum($num) $this-showPageNum = $num; /* * ? ? 3? ?3?D? * * param integer $num ? 3? ?3?D? * return void */ public function setCurrentInd

8、exPage($num) 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 10 页 - - - - - - - - - $this-curIndexPage = $num; /* * ? ? ?3? * * param string $text a? * return void */ public function setFirstPageText($text) $this-firstPageText = $text; /* * ? ? ?o ?3? * * param

9、string $text a? * return void */ public function setLastPageText($text) $this-lastPageText = $text; /* * ? ? ?3? * * param string $text a? * return void */ public function setPrePageText($text) $this-prePageText = $text; /* * ? ?3? * * param string $text a? * return void */ public function setNextPa

10、geText($text) $this-nextPageText = $text; /* 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 10 页 - - - - - - - - - * ? ?3?css? ?class?3? * * param string $css css? ?3? * return void */ public function setPageCss($css) $this-pageCss = $css; /* * ? ? 3?css? ?clas

11、s?3? * * param string $css css? ?3? * return void */ public function setCurrentPageCss($css) $this-curPageCss = $css; /* * ? ?3? ?style ?D? * * param string $style style? ? * return void */ public function setPageStyle($style) $this-pageStyle = $style; /* * ? ? 3? ?style ?D? * * param string $style

12、style? ? * return void */ public function setCurrentPageStyle($style) $this-curPageStyle = $style; /* * ? ?D3? ?page=2?D?=? * * param string $symbol ? ?o? * return void 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 10 页 - - - - - - - - - */ public function set

13、LinkSymbol($symbol) $this-linkSymbol = $symbol; /* * ? 3y * * access private * return integer */ public function getTotalPageNum() return $this-totalPageNum; /* * ? ?3?o ?3? ? * * param boolean $is true:?false:2? * return void */ public function isShowFirstAndLast($is) $this-isShowFirstLast = $is; /

14、* * ? ?D?3 ?3 * * param boolean $is true:?false:2? * return void */ public function isShowForSimplePage($is) $this-isShowForSimplePage = $is; /* * 11? ? * * param integer $eachDisNums ?3?y * param integer $nums ?y * param integer $current_num ? ?D?3 * param integer $showPageNum ?3y * param integer $

15、subPageLink ?3? ? * param integer $subPage_type ?3? D 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 10 页 - - - - - - - - - * return void */ public function _construct($eachDisNums, $nums, $currentPage, $subPageLink) $this-eachDisNums=intval($eachDisNums); $num

16、s = $nums=0 ? 1: $nums; $this-nums = intval($nums); $this-totalPageNum = ceil($nums/$eachDisNums); $this-currentPage =intval($currentPage); $this-currentPage = $this-currentPagecurrentPage; $this-currentPage = $this-currentPage $this-totalPageNum ? 1 : $this-currentPage; $this-subPageLink = $subPage

17、Link; $this-lastPageText = .$this-totalPageNum; public function _destruct() unset($this-eachDisNums); unset($this-nums); unset($this-currentPage); unset($this-showPageNum); unset($this-curIndexPage); unset($this-totalPageNum); unset($this-arrPage); unset($this-subPageLink); unset($this-firstPageText

18、); unset($this-lastPageText); unset($this-prePageText); unset($this-nextPageText); unset($this-pageCss); unset($this-curPageCss); unset($this-pageStyle); unset($this-curPageStyle); unset($this-linkSymbol); unset($this-isShowFirstLast); unset($this-isShowForSimplePage); /* * 3 ?3 * * return string */

19、 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 10 页 - - - - - - - - - public function generatePages() $subPageCss2Str = ; $isShow = false; if($this-totalPageNum = 1) /?D?3 if($this-isShowForSimplePage) $isShow = true; else $isShow = true; if($isShow) if($this-

20、currentPage 1) $prewPageUrl = $this-subPageLink.$this-linkSymbol.($this-currentPage-1); if($this-isShowFirstLast) $firstPageUrl = $this-subPageLink.$this-linkSymbol.1; $subPageCss2Str .= pageCss. style=.$this-pageStyle.$this-firstPageText.; $subPageCss2Str .= pageCss. style=.$this-pageStyle.$this-pr

21、ePageText.; $a=$this-construct_num_Page(); for($i=0;$icurrentPage ) $subPageCss2Str .= curPageCss. style=.$this-curPageStyle.$s.; else $url = $this-subPageLink.$this-linkSymbol.$s; $subPageCss2Str .= pageCss. style=.$this-pageStyle.$s.; if($this-currentPage totalPageNum) $nextPageUrl = $this-subPage

22、Link.$this-linkSymbol.($this-currentPage+1); $subPageCss2Str .= pageCss. style=.$this-pageStyle.$this-nextPageText.; if($this-isShowFirstLast) $lastPageUrl = $this-subPageLink.$this-linkSymbol.$this-totalPageNum; $subPageCss2Str .= pageCss. style=.$this-pageStyle.$this-lastPageText. ; return $subPag

23、eCss2Str; /End of generatePages() Method /* * ? ? ?3?y 3? ?o y? * * return array */ private function initArray() for($i=0; $i showPageNum; $i +) $this-arrPage$i = $i; return $this-arrPage; /End of initArray() Method /* * ? 11? * ? o12345678910 * * return array */ private function construct_num_Page(

24、) if($this-totalPageNum showPageNum) $currentArray = array(); for($i=0; $i totalPageNum; $i +) $currentArray$i = $i + 1; else $currentArray = $this-initArray(); $curArrayLen = count($currentArray); if($this-currentPage curIndexPage) for($i=0; $i currentPage totalPageNum) & ($this-currentPage ($this-

25、totalPageNum - $this-showPageNum + 1) /11? ?o ?3?35 36 37 38 39 40 ? ?3 ?o ?3 3y?a40 for($i=0; $i totalPageNum - $this-showPageNum + 1 + $i; else for($i=0; $i currentPage - $this-curIndexPage + 1 +$i; return $currentArray; /End of construct_num_Page() Method /End of Pages Class ? Tagso? php ?3 ? ? ?

26、D D? ? ? ?1? ? ?¥2? ?ao?php? ? ? ?ao?a?linux? 3?D?3?. ?o?o? ASP?PHP? ? .NET?JSP? y?Y?a?3 ? t? ? ? ?-? ? ? ?1?3 ? ? PHPWind ?(?DD? ?33D) 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 9 页,共 10 页 - - - - - - - - - Discuz!7.2 X1?(? ?2? ? ?3? 3) PHP168?(1|? ? ,?a ?a? ?CM

27、S? 3) ? ?ASP? 3(? ?3?) 3 ? ?t ? WinRAR 64?( ? ?a?1? ?t) QQDy? (? ?,? ¥ ?,?T1?) ?3 |( 2?t? 2a1?, D?) Windows? ? ? 64?(31 ?3y?) ?a? ?(2? ? , ?a?) ?QQ2010(? 1?1?o? ?t) FileZilla(?D ?FTP? ?t) PHP? ? ?PHPD ?1|? ? o? ?o y?oGD?a ?HTML?D ?js ?php? Y-?y? y ?PHP ?3MYSQLo MYSQL5.1?D? ?| ? ?mysql ?a?1¥? ?Mysql2 ?3 ? ?PHP 5.3 ? VC9?VC6? Thread S Copyright?(MyCodes.Net) all rights reserved 2002-2010 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 10 页,共 10 页 - - - - - - - - -

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 高考资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com