高洛峰老师的 php 分页类

高洛峰老师的 php 分页类

ID:9794131

大小:34.50 KB

页数:4页

时间:2018-05-10

高洛峰老师的 php 分页类_第1页
高洛峰老师的 php 分页类_第2页
高洛峰老师的 php 分页类_第3页
高洛峰老师的 php 分页类_第4页
资源描述:

《高洛峰老师的 php 分页类》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、'记录','frist'=>'首页','pre'=>'上一页','next'=>'下一页','fist'=>'首页','last'=>'尾页');publicfunction__construct($total,$eachpagenum,$pa){$this->total=$total;

2、$this->eachpagenum=$eachpagenum;$this->uri=$this->geturi($pa);$this->page=!empty($_GET['page'])?$_GET['page']:1;$this->pagenum=ceil($this->total/$this->eachpagenum);$this->limit=$this->setlimit();}//privatefunctionnowpage(){//if($_GET['page']<=0){//return1;//}elseif($_GET['page']>$this

3、->pagenum){//return$this->pagenum;//}else{//return$_GET['page'];//}//}privatefunctiongeturi($pa){$url=$_SERVER['REQUEST_URI'].(strpos($_SERVER['REQUEST_URI'],"?")?"":"?").$pa;$parse=parse_url($url);if(isset($parse["query"])){parse_str($parse["query"],$params);unset($params["page"]);$ur

4、l=$parse["path"]."?".http_build_query($params);return$url;}else{return$url;}}privatefunctionsetlimit(){return"limit".($this->page-1)*$this->eachpagenum.",{$this->eachpagenum}";}privatefunction__get($args){if($args=="limit"){return$this->limit;}else{returnnull;}}privatefunctionstar(){if

5、($this->total==0){return0;}else{return($this->page-1)*$this->eachpagenum+1;}}privatefunctionend(){returnmin($this->page*$this->eachpagenum,$this->total);}privatefunctioneachpagenum1(){return$this->end()-$this->star()+1;}privatefunctionfrist(){if($this->page==1){$html.=" {$this->co

6、nfig['frist']}";}else{$html.=" uri}&page=1'>{$this->config['frist']}";}return$html;}privatefunctionpre(){if($this->page>1){$html.=" uri}&page=".($this->page-1)."'>{$this->config['pre']}";}else{$html.=" {$this->config['pre']}";}retu

7、rn$html;}privatefunctionpagelist(){$linkpage="";$lastlist=floor($this->listnum/2);for($i=$lastlist;$i>=1;$i--){$page=$this->page-$i;if($page>=1){$linkpage.=" uri}&page={$page}'>{$page}";}else{continue;}}$linkpage.=" {$this->page}";for($i=1;$i<=$lastlist;

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。