首頁 >php教程 >php手册 >php 分页类(第一版本),

php 分页类(第一版本),

WBOY
WBOY原創
2016-06-13 09:43:391238瀏覽

此版本为第一版 , 以get 方式传递页码数及其他参数 .  

使用方法 :1  

getLimit();  

int(90)  ["end"]=> string(3) "100"   }

 

pageInfo($arr); 获取页码信息如下 : 首页,上一页 ,下一页,尾页等按实际情况显示

<span   </span><span <</span><span p</span><span ></span>总记录:<span <</span><span span </span><span style</span><span ="color:red"</span><span ></span>100<span </</span><span span</span><span ></span>条 页码7/10<span </</span><span p</span><span ><br />   <</span><span a </span><span href</span><span ="/index.php/index/pro?heng=1&page=1"</span><span ></span>首页<span </</span><span a</span><span ><br />  <</span><span a </span><span href</span><span ="/index.php/index/pro?heng=1&page=6"</span><span ></span>上一页<span </</span><span a</span><span ><br />  <</span><span a </span><span href</span><span ="/index.php/index/pro?heng=1&page=5"</span><span ></span>5<span </</span><span a</span><span ><br />  <</span><span a </span><span href</span><span ="/index.php/index/pro?heng=1&page=6"</span><span ></span>6<span </</span><span a</span><span ><br />  <</span><span span</span><span ></span>7<span </</span><span span</span><span ><br />  <</span><span a </span><span href</span><span ="/index.php/index/pro?heng=1&page=8"</span><span ></span>8<span </</span><span a</span><span ><br />  <</span><span a </span><span href</span><span ="/index.php/index/pro?heng=1&page=9"</span><span ></span>9<span </</span><span a</span><span ><br />  <</span><span a </span><span href</span><span ="/index.php/index/pro?heng=1&page=8"</span><span ></span>下一页<span </</span><span a</span><span ><br />  <</span><span a </span><span href</span><span ="/index.php/index/pro?heng=1&page=10"</span><span ></span>尾页<span </</span><span a</span><span ></span>

      

      pageInfo() 默认参数及顺序为 'count','first','count','pre','listing','next','last' . 可自行设置:

<span 1</span>      <span $arr</span>   = <span array</span><span ( 
</span><span 2</span>               'count','first','pre','listing','next','last'
<span 3</span> <span        );
</span><span 4</span>       <span $pageInfo</span> = <span $page</span>->pageInfo(<span $arr</span>);

      4 可以使用 setPageListNum() 方法设置页码显示个数 

 <span $page</span>->setPageListNum(<span $num</span>); 

      

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn