cakephp pagination
how in one controller use more than one pagination? I have this code:
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,
开发者_C百科 'order' => array(
'post.id' => 'asc',
),
),
);
How in one controller use two different pagination?
function otherAction() {
$this->paginate = array('post' => array('conditions' => ...)));
$posts = $this->paginate();
}
or
$posts = $this->paginate('Post', array('conditions' => array()));
精彩评论