Detailed thinkphp Framework page class and Bootstrap page class code

Source: Internet
Author: User
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}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.