开发者

cakephp pagination

开发者 https://www.devze.com 2023-02-04 23:33 出处:网络
how in one controller use more than one pagination? I have this code: var $paginate = array( \'post\' => array(

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()));
0

精彩评论

暂无评论...
验证码 换一张
取 消