public static remember ( string | array $url = '', string $name = null ) | ||
$url | string | array | the URL to remember. Please refer to [[to()]] for acceptable formats. If this parameter is not specified, the currently requested URL will be used. |
$name | string | the name associated with the URL to be remembered. This can be used later by [[previous()]]. If not set, it will use [[\yii\web\User::returnUrlParam]]. |
public static function remember($url = '', $name = null)
{
$url = static::to($url);
if ($name === null) {
Yii::$app->getUser()->setReturnUrl($url);
} else {
Yii::$app->getSession()->set($name, $url);
}
}
/** * @inheritdoc */ public static function remember($url = '', $name = null) { if ($name === null) { self::rememberStack(); } else { parent::remember($url, $name); } }