Home >Backend Development >PHP Tutorial >PHP paging class (first version),_PHP tutorial
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&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>
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>);