Home  >  Article  >  Backend Development  >  PHP paging class (first version),_PHP tutorial

PHP paging class (first version),_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:39:21994browse

This version is the first version, and the page number and other parameters are passed in the get method.

How to use: 1

<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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;page=10"</span><span ></span>尾页<span </</span><span a</span><span ></span>

  

The default parameters and order of pageInfo() are 'count', 'first', 'count', 'pre', 'listing', 'next', 'last'. You can set it yourself:

<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 You can use the setPageListNum() method to set the number of displayed page numbers

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

  

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/732357.htmlTechArticleThis version is the first version, and the page number and other parameters are passed in the get method. Usage method: 1 Total records: 100 page numbers 7/10 Home page Previous page 5 6 7 8 9 Next page Last page pageInfo() Default parameters...
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