荫对象方面得到了如下的错误Fatal error: Using $this when not in object context in ..\controllers\ServiceRequestController.php on line 661
调用使用从EasyTabs扩展控制器动作视图文件时。
荫调用视图文件ServiceRequestController::actionTest();
和控制器
public static function actionTest()
{
$this->redirect('test');
}
我怎样才能摆脱这种错误的这样的控制器操作?当我Google搜索时,我发现$this cannot be used in a static method.
。所以我尝试了用在我看来$model = new ServiceRequest(); $model->Test();
file.But它显示的错误为ServiceRequest and its behaviors do not have a method or closure named "actionTest".
谁能帮我修复错误?在此先感谢 我试图修复使用此链接。但我认为Iam错了。 PHP Fatal error: Using $this when not in object context
我怎么能实现它在这种情况下? – anu 2013-05-02 09:20:15