标签:
$Table = M(‘Table‘);
$count = $Table ->where()->count();
$Page = new \Think\Page($count,10);
//自定义分页样式
$Page -> setConfig(‘next‘,‘下一页‘);
$Page -> setConfig(‘prev‘,‘上一页‘);
$Page -> setConfig(‘last‘,‘尾页‘);
$Page -> setConfig(‘first‘,‘首页‘);
$Page -> setConfig(‘theme‘,‘%HEADER% %FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END%‘);
$show = $Page->show();
$this->assign(‘page‘,$show);
$res = $Table->where()->limit($Page->firstRow.‘,‘.$Page->listRows)->select();
$this->assign(‘res‘,$res);
标签:
原文地址:http://www.cnblogs.com/isungge/p/4721844.html