我有問題讓CakeDC的標籤插件工作。我已經非常仔細地閱讀了文檔,但看起來文檔非常陳舊。CakePHP標籤插件分頁問題
// Totally works. Does what it is supposed to do, does not
// complain of missing models.
$tag = $this->Upload->Tagged->find('tagged',
array('by' => $tagname, 'model' => 'Upload', 'conditions' =>
array('Upload.soft_delete !=' => 1)));
// 100% correct according to the 3 year old documentation.
// Complains of a missing "taggeds" model.
// Table taggeds for model Tagged was not found in datasource default.
// Undefined index: tagged [CORE/Cake/Model/Model.php, line 2731]
$this->paginate['Tagged'] = array(
'model' => 'Upload',
'tagged',
'by' => $tagname);
$tag = $this->paginate('Tagged');
我在這裏閱讀文檔:https://github.com/CakeDC/tags/wiki/Find-tagged-objects
起初,我經歷重載屬性$ PAGINATE ......沒有效果」的錯誤的間接修改,直到我說公衆$ PAGINATE =陣列(); 。到了我的控制器的頂部。這並沒有幫助其他錯誤
希望我失去了一些東西簡單在這裏
UPDATE:我改變了代碼看起來像這樣
$this->Paginator->settings['Tagged'] = array(
'tagged',
'model' => 'Upload',
'by' => $tagname
);
$this->Paginator->paginate('Tagged');
,我得到這個錯誤:錯誤:調用一個成員函數PAGINATE()非對象
「錯誤:調用一個成員函數PAGINATE()一個非對象「以及」間接修改重載屬性SearchesController :: $ Paginator不起作用「 – baordog