如何在一个控制器中使用多个分页? 我有这段代码:
var $paginate = array(
'post' => array(
'limit' => 2,
'order' => array(
'post.id' => 'asc',
),
),
);
**And in the same controller need this paginate:**
var $paginate = array(
'post' => array(
'conditions' => array('Post.name IS NULL or Post.id>50'),
'limit' => 20,
'order' => array(
'post.id' => 'asc',
),
),
);
如何在一个控制器中使用两个不同的分页?
答案 0 :(得分:1)
function otherAction() {
$this->paginate = array('post' => array('conditions' => ...)));
$posts = $this->paginate();
}
或
$posts = $this->paginate('Post', array('conditions' => array()));