Beispiel #1
0
 /**
  * Fetch COOKIE data
  *
  * This method returns a key-value array of Cookie data sent in the HTTP request, or
  * the value of a array key if requested; if the array key does not exist, NULL is returned.
  *
  * @param  string            $key
  * @return array|string|null
  */
 public function cookies($key = null)
 {
     if ($key) {
         return $this->cookies->get($key);
     }
     return $this->cookies;
     // if (!isset($this->env['pulse.request.cookie_hash'])) {
     //     $cookieHeader = isset($this->env['COOKIE']) ? $this->env['COOKIE'] : '';
     //     $this->env['pulse.request.cookie_hash'] = Util::parseCookieHeader($cookieHeader);
     // }
     // if ($key) {
     //     if (isset($this->env['pulse.request.cookie_hash'][$key])) {
     //         return $this->env['pulse.request.cookie_hash'][$key];
     //     } else {
     //         return null;
     //     }
     // } else {
     //     return $this->env['pulse.request.cookie_hash'];
     // }
 }
Beispiel #2
0
 /**
  * Return view data value with key
  * @param  string $key
  * @return mixed
  */
 public function get($key)
 {
     return $this->data->get($key);
 }