注销时未定义的类Yii2
我要走了 找不到类“common\models\ErrorHandler” 当我同时注销前端和后端操作时,与正常注销没有什么不同注销时未定义的类Yii2,yii2,Yii2,我要走了 找不到类“common\models\ErrorHandler” 当我同时注销前端和后端操作时,与正常注销没有什么不同 /** * Logs out the user. * @return \yii\web\Response */ public function actionLogout() { Yii::$app->user->logout(); return $this->goHome
/**
* Logs out the user.
* @return \yii\web\Response
*/
public function actionLogout()
{
Yii::$app->user->logout();
return $this->goHome();
}
谢谢,显示您的
errorHandler
配置部分'errorHandler'=>['errorAction'=>'site/error',],它在common/config中定义,并且它只与上面在frontend/config
和backend/config
中所述的一样,我认为这与您的命名空间有关。您忘了向ErrorHandler或类似的东西添加完整的命名空间。在项目中搜索ErrorHandler
字符串,并将其指定为\yii\web\ErrorHandler