如何在Cakephp 2.0中配置搜索插件

时间:2011-11-01 00:50:20

标签: cakephp cakephp-2.0

我试图将搜索插件合并到我的项目中,我认为我遵循了下载站点的说明,但每当我访问帖子时,它都会给我这3行错误:

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]

有人可以帮我解决这个问题吗?

谢谢!

2 个答案:

答案 0 :(得分:4)

在Cakephp 2.0组件类范围中,组件不是对象

所以,写下面的代码:

class PrgComponent extends Component {

}

答案 1 :(得分: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搜索插件吗?