/** * Set a cookie * * {@inheritdoc} * * A value may either be a string or a ResponseCookie instance * String values will be converted into a ResponseCookie with * the "name" of the cookie being set from the "key" * * Obviously, the developer is free to organize this collection * however they like, and can be more explicit by passing a more * suggested "$key" as the cookie's "domain" and passing in an * instance of a ResponseCookie as the "$value" * * @see DataCollection::set() * @param string $key The name of the cookie to set * @param ResponseCookie|string $value The value of the cookie to set * @access public * @return ResponseCookieDataCollection */ public function set($key, $value) { if ($value instanceof \Norma\Router\FormatRoute) { return parent::set($key, $value); } return false; }
/** * Add Key/Value pair to collection * * @param $key string * @param $value mixed */ public function set($key, $value) { $key = str_replace('_', '-', strtolower($key)); parent::set($key, $value); }
/** * Set a header * * {@inheritdoc} * * @see DataCollection::set() * @param string $key The name of the header to set * @param mixed $value The value of the header to set * @access public * @return HeaderDataCollection */ public function set($key, $value) { $key = static::normalizeName($key); return parent::set($key, $value); }
/** * Set a header * * {@inheritdoc} * * @see DataCollection::set() * @param string $key The key of the header to set * @param mixed $value The value of the header to set * @return HeaderDataCollection */ public function set($key, $value) { $key = $this->normalizeKey($key); return parent::set($key, $value); }