yii\web\Controller::goBack PHP Метод

goBack() публичный Метод

You can use this method in an action by returning the Response directly: php stop executing this action and redirect to last visited page return $this->goBack(); For this function to work you have to [[User::setReturnUrl()|set the return URL]] in appropriate places before.
См. также: User::getReturnUrl()
public goBack ( string | array $defaultUrl = null ) : Response
$defaultUrl string | array the default return URL in case it was not set previously. If this is null and the return URL was not set previously, [[Application::homeUrl]] will be redirected to. Please refer to [[User::setReturnUrl()]] on accepted format of the URL.
Результат Response the current response object
    public function goBack($defaultUrl = null)
    {
        return Yii::$app->getResponse()->redirect(Yii::$app->getUser()->getReturnUrl($defaultUrl));
    }