Controller:
$User = M (' webcase '); Instantiating a User object
$list = $User->order (' id desc ')->page ($_get[' P ']. ', 6 ')->select ();
$this->assign (' list ', $list);//Assignment Data set
$count = $User->count ();//query satisfies the required total number of records
$Page = new \think\page ($count, 6);//Instantiate the total number of incoming records for the paging class and the number of records displayed per page
$show = $Page->show ();//pagination display output
$this->assign (' page ', $show);//Assignment 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}" > {$new .keyword}</a></td>
</tr>
</volist>
<TR class= "Content" >
<TD colspan= "3" bgcolor= "#FFFFFF" ><div class= "pages" >
{$page}
</div></td>
</tr>
thinkphp Paged Integration