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.