Thinkphp paging integration instance and thinkphp paging instance

Source: Internet
Author: User

Thinkphp paging integration instance and thinkphp paging instance

Controller:

$ User = M ('webcase'); // instantiate the User object $ list = $ User-> order ('Id desc ') -> page ($ _ GET ['P']. ', 6')-> select (); $ this-> assign ('LIST', $ list); // assign a dataset $ count = $ User-> count (); // query the total number of records meeting the requirements $ Page = new \ Think \ Page ($ count, 6 ); // instantiate the total number of incoming records in the paging class and the number of records displayed on each Page $ show = $ Page-> show (); // display output by page $ this-> assign ('page', $ show); // value-assigned paging output $ this-> display (); // output Template

View:

<volist name='list' id='new' > <tr class="content">  <td><a href="/?m=home&c=index&a=detail&id2={$new.id}" rel="external nofollow" > {$new.keyword}</a></td>        </tr>        </volist>      <tr class="content">        <td colspan="3" bgcolor="#FFFFFF"><div class="pages">            {$page}        </div></td>       </tr>

The above thinkphp paging integration instance is all the content shared by xiaobian. I hope you can give us a reference and support the help house.

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.