$count = $article->where($map)->count();
$p = new Page($count,1);
//分页跳转的时候保证查询条件
$condition = array('tdf'=>$keyword,'dz'=>$dz,'nf'=>$nf,'lb'=>$lb,);
foreach($condition as $key=>$val) {
$p->parameter[$key] = urlencode($val);
}
dump($p);
$p->setConfig('prev','上一页');
$p->setConfig('header','篇文章');
dump内容:
ob
public 'firstRow' => int 0
public 'listRows' => int 1
public 'parameter' =>
array
'tdf' => string '590' (length=3)
'dz' => string '%E5%8C%97%E4%BA%AC' (length=18)
'nf' => string '2012' (length=4)
'lb' => string '%E6%96%87%E5%8F%B2' (length=18)
点击下一页后,dump内容:
ob
public 'firstRow' => int 1
public 'listRows' => int 1
public 'parameter' =>
array
'tdf' => string '' (length=0)
'dz' => string '' (length=0)
'nf' => string '' (length=0)
'lb' => string '' (length=0)
可见POST参数没保持。
最佳答案