Paginator没有生成链接

时间:2014-01-20 09:58:37

标签: cakephp pagination

我坚持这个......这是我的代码:

private function moderators () {
    $this->loadModel('Moderator');
    $this->Moderator->Behaviors->load('Containable');
    $this->Paginator = $this->Components->load('Paginator');
    $this->Paginator->settings = array(
        'contain' => array(
            'ModeratorPersonalData' => array(
                'conditions' => array('language' => $this->params['language']),
            ),
            'Thumb',
            'Image',
        ),
        'limit' => 1,
        'conditions' => array('role' => 'moderator'),
    );
    $moderators = $this->Paginator->paginate('Moderator');
    $this->set('moderators', $moderators);
}

分页有效,当我手动输入第2页的网址时,它会将我带到那里,但它没有显示可点击的链接。

1 个答案:

答案 0 :(得分:1)

你确实在视图文件中使用了Paginator助手,不是吗? http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper