コード例 #1
0
ファイル: User.php プロジェクト: romeoz/rock
 /**
  * Remembers the URL in the session so that it can be retrieved back later by {@see \rock\user\User::getReturnUrl()}.
  * @param string|array $url the URL that the user should be redirected to after login.
  */
 public function setReturnUrl($url)
 {
     $this->storage->add($this->returnUrlParam, $url);
 }
コード例 #2
0
 /**
  * Saves the number of allowed requests and the corresponding timestamp to a persistent storage.
  *
  * @param string        $name name of action e.g. `FooController::actionIndex`
  * @param integer $maxRequests the number of allowed requests remaining.
  * @param integer $timestamp   the current timestamp.
  */
 public function saveAllowance($name, $maxRequests, $timestamp)
 {
     $this->session->add(['_allowance', $name], ['maxRequests' => $maxRequests, 'timestamp' => $timestamp]);
 }