yii中redirect的使用

CException:

DatabaseSearch and its behaviors do not have a method or closure named "redirect".

error:在继承CComponent类的子类中我使用$this->redirect()时报错:
子类名 and its behaviors do not have a method or closure named "redirect"

注意

  • 该类和父类CComponent中并没有redirect方法的声明;

  • redirect在CControler与CHttpRequest之中都有被定义;

问题
我有两个想法,要么在该类中声明redirect方法,要么想方法调用CControler与CHttpRequest之中的redirect,请问这两种方法是否可行,麻烦详细解答下,万分感谢

阅读 3.4k
1 个回答

直接用CControler与CHttpRequest之中的redirect,有什么顾虑吗?

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题