Thinkphp comes with pagination class

Source: Internet
Author: User

Thinkphp comes with pagination use case:

$Data  = m (' data '); //  instantiate the data object   date  is your table name     import (' ORG. Util.page ');//  import paging class      $count  =  $Data->where ($map)->count ();//  The total number of records that the query meets the requirements   $MAP represents the query criteria      $Page  = new page ($count);//  instantiate the paging class   Incoming total records      $show  =  $Page->show ();//  pagination display output     / /  Paging data query      $list  =  $Data->where ($map)->order (' id ')->limit ($ Page->firstrow. ', '. $Page->listrows)->select (); //  $Page->firstrow  starting bar   $Page- >listRows  get how many      $this->assign (' list ', $list);//  assignment Datasets       $this->assign (' page ', $show);//  assignment paging output      $this->display (); //  Output Templates         <table cellpadding=3 cellspacing=5>< Volist name= "LIst " id=" vo "><tr><td >[ {$vo. create_time|date= ' y-m-d h:i:s ', ###} ]  {$vo .title} </td></tr></volist><tr>         </tr></table><div class= "Result page" >{$page}</div>

Paging Effect:

650) this.width=650; "src=" Http://www.thinkphp.cn/Uploads/editor/2015-11-06/563cccd6b7d0a.png "alt=" 563cccd6b7d0a.png "/>

Thinkphp comes with pagination class

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.