yii\helpers\BaseUrl::previous PHP 메소드

previous() 공개 정적인 메소드

Returns the URL previously [[remember()|remembered]].
또한 보기: remember()
public static previous ( string $name = null ) : string | null
$name string the named associated with the URL that was remembered previously. If not set, it will use [[\yii\web\User::returnUrlParam]].
리턴 string | null the URL previously remembered. Null is returned if no URL was remembered with the given name.
    public static function previous($name = null)
    {
        if ($name === null) {
            return Yii::$app->getUser()->getReturnUrl();
        } else {
            return Yii::$app->getSession()->get($name);
        }
    }

Usage Example

예제 #1
0
 public static function previous($name = null)
 {
     if ($name === null) {
         return self::getLastUrl();
     }
     return parent::previous($name);
 }