yii\web\User::getReturnUrl PHP 메소드

getReturnUrl() 공개 메소드

This method reads the return URL from the session. It is usually used by the login action which may call this method to redirect the browser to where it goes after successful authentication.
또한 보기: loginRequired()
public getReturnUrl ( string | array $defaultUrl = null ) : string
$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 [[setReturnUrl()]] on accepted format of the URL.
리턴 string the URL that the user should be redirected to after login.
    public function getReturnUrl($defaultUrl = null)
    {
        $url = Yii::$app->getSession()->get($this->returnUrlParam, $defaultUrl);
        if (is_array($url)) {
            if (isset($url[0])) {
                return Yii::$app->getUrlManager()->createUrl($url);
            } else {
                $url = null;
            }
        }
        return $url === null ? Yii::$app->getHomeUrl() : $url;
    }