2011-11-01 54 views
1

我試圖將搜索插件到我的項目,我想我也跟着從下載網站上的指示,但每當我訪問帖子它給了我這3個行錯誤:如何配置搜索插件在CakePHP 2.0

Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'PrgComponent' does not have a method 'startup' [CORE\Cake\Utility\ObjectCollection.php, line 110] 

Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'PrgComponent' does not have a method 'beforeRender' [CORE\Cake\Utility\ObjectCollection.php, line 110] 

Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'PrgComponent' does not have a method 'shutdown' [CORE\Cake\Utility\ObjectCollection.php, line 110] 

有人可以幫我解決這個問題嗎?

謝謝!

+0

好像無論是插件或您的代碼不匹配的有效回調的2.0的要求。你有什麼搜索插件版本? – mark

回答

1

下載網站?哪個下載網站?這個插件的2.0版沒有「下載網站」。

2.0分支在這裏https://github.com/CakeDC/search/tree/2.0和PrgComponent通道的所有測試。

9/9 test methods complete: 9 passes, 0 fails, 13 assertions and 0 exceptions. 
Time: 0.29582810401917 seconds 

Peak memory: 11,688,424 bytes 

Run more tests | Show Passes | Analyze Code Coverage 

Code coverage results Toggle all files 
PrgComponent.php Code coverage: 99.06% 

從git中檢查2.0分支。

你甚至在談論CakeDC搜索插件嗎?

+0

嗨Burzum,我說的下載網站是來自cakedc的。這是爲1.3,但不知道它是否會與2.0工作,但謝謝你,我會嘗試你提供的鏈接。我會把這標記爲我的問題的答案。欣賞它! – Lyman

+0

歡迎,如果您還想使用1.3版本,請使用github上的master分支而不是下載。我認爲我們需要刪除下載部分,那裏的文件非常過時。 – burzum

4

在CakePHP 2.0組件類範圍組件沒有對象

所以,寫下面的代碼:

class PrgComponent extends Component { 

}