标签:list isset ber nat page bsp new pat false
tp5的分页:
public function index()
{
$page = input(‘get.page‘);
if (isset($page) && null !== $page) {
$cpage = $page;
}
else {
$cpage = 1;
}
$options=[
‘page‘=>$cpage,
‘path‘=>url(‘index‘)
];
$list=Db::name(‘web_member‘)->paginate(10,false,$options);
$this->assign(‘list‘, $list);
return $this->fetch();
}
在html的展示页中要加上 {$list->render()} 来展示分页的页数
tp3的分页:
public function paylist(){
$p= I("get.p/d",1);
$model = M("pay");
$count = $model->count();
$Page = new Page($count,10);
$show = $Page->show();
$data = $model->order(‘id desc‘)->page($p.‘,10‘)->select();
$this->assign(‘data‘,$data);
$this->assign(‘page‘,$show);
$this->display();
}
在html的展示页中要加上 {$page} 来展示分页的页数
标签:list isset ber nat page bsp new pat false
原文地址:http://www.cnblogs.com/nnhgd/p/7953705.html