コード例 #1
0
 /**
  * @return string
  */
 public function getToken()
 {
     if ($this->token === null) {
         $name = $this->getTokenName();
         $token = Request::getCookieParam($name);
         if ($token !== null) {
             $this->token = $token;
         } else {
             throw new InvalidOperationException('Csrf protection is not initialized correctly.');
         }
     }
     return $this->token;
 }
コード例 #2
0
 /**
  * @param string $name
  * @param mixed $default
  * @return mixed
  */
 public function getCookieParam($name, $default = null)
 {
     return Request::getCookieParam($name, $default);
 }