This article mainly and everybody introduced thinkphp frame page class and Bootstrap page (beautify), need friend can refer to, hope can help to everybody.
Bootstrap how to use the style here to write the link content
<nav aria-label= "page navigation" > <ul class= "pagination" > <li> <a href= "#" rel= "external nofollow "Rel=" external nofollow "rel=" external nofollow "rel=" external nofollow "rel=" external nofollow "rel=" external nofollow "Rel=" external nofollow "aria-label=" Previous "> <span aria-hidden=" true ">«</span> </a> </li > <li><a href= "#" rel= "external nofollow" rel= "external nofollow" rel= "external nofollow" rel= "External Nofo Llow "rel=" external nofollow "rel=" external nofollow "rel=" external nofollow ">1</a></li> <li> <a href= "#" rel= "external nofollow" rel= "external nofollow" rel= "external nofollow" rel= "external nofollow" rel= " External nofollow "rel=" external nofollow "rel=" external nofollow ">2</a></li> <li><a href=" # " Rel= "External nofollow" rel= "external nofollow" rel= "external nofollow" rel= "external nofollow" rel= "External nofollow" Rel= "External nofollow" rel= "external nofolLow ">3</a></li> <li><a href=" # "rel=" external nofollow "rel=" external nofollow "rel=" external nofollow "rel=" external nofollow "rel=" external nofollow "rel=" external nofollow "rel=" External nofollow ">4</a ></li> <li><a href= "#" rel= "external nofollow" rel= "external nofollow" rel= "external nofollow" rel= " External nofollow "rel=" external nofollow "rel=" external nofollow "rel=" external nofollow ">5</a></li> & Lt;li> <a href= "#" rel= "external nofollow" rel= "external nofollow" rel= "external nofollow" rel= "External nofollow" Rel= "External nofollow" rel= "external nofollow" rel= "external nofollow" aria-label= "Next" > <span aria-hidden= "tr UE >»</span> </a> </li> </ul></nav>1. Locate the Page.class.php in thinkphp, and then use the following file contents to completely replace <?php//+----------------------------------------------------------------------//| thinkphp [WE CAN do it JUST THINK it]//+----------------------------------------------------------------------// | Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.//+-------------------------------------------------- --------------------// | Licensed (http://www.apache.org/licenses/LICENSE-2.0)//+------------------------------------------------------- ---------------// | Author: Mai fuel <zuojiazi@vip.qq.com>
2. Related Controller code
All public function All_news () { $Article =m ("article"); $where [' Article_type ']=1; The total number of records that the query meets the requirements $count = $Article->where ($where)->count (); Instantiate the total number of incoming records in the paging class and the number of records displayed by the coal industry $Page =new \think\page ($count, 1); Pagination Display output $show = $Page->show (); For paging data query Note the parameter of the limit method to use the properties of the page class $news = $Article->where ($where)->order (' Pub_time ')->field (' ID, Title,institution_type,author_name,pub_time ')->limit ($Page->firstrow ', '. $Page->listrows)->select ( ); Assignment Data Set $this->assign (' News ', $news); Assignment paging output $this->assign (' page ', $show); $this->display (); }
Only required in 3.html
<p class= "Panel-body Center" > {$page}