Hello. I have a very old project in yii2. And recently I updated it to the latest version.
So, I have next code in my controller:
public function beforeAction($action)
{
...
if (!Yii::$app->request->isAjax) {
return $this->goBack();
}
...
}
And I see error: Call to a member function redirect() on string
.
yii\web\Controller:
public function goBack($defaultUrl = null)
{
return $this->response->redirect(Yii::$app->getUser()->getReturnUrl($defaultUrl));
}
and $this->response
it is a string.
Am I missing something?