cakephp分页中的问题

issue in cakephp pagination

我正在使用此代码获取基于类别的数据

$this->paginate=$this->Project->find('all', array('conditions' => array('category' => $this->request->data['Project']['category'])));
        $this->set('projects', $this->paginate);

通过使用上面的代码我得到了这些错误

Warning (2): array_filter() expects parameter 1 to be array, null given [CORE\Cake\View\Helper\PaginatorHelper.php, line 403]
Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [CORE\Cake\View\Helper\PaginatorHelper.php, line 403]

我该如何解决这个问题?

您的代码有误。

使用:

$this->Paginator->settings = array('conditions' => array('Project.category' => $this->request->data['Project']['category']));
$this->set('projects', $this->Paginator->paginate());