Symfony\Component\HttpFoundation\ResponseHeaderBag
ResponseHeaderBag is a container for Response HTTP headers.
- Author: Fabien Potencier <fabien@symfony.com>
Synopsis
class ResponseHeaderBag
extends HeaderBag
{
- // constants
- const COOKIES_FLAT = 'flat';
- const COOKIES_ARRAY = 'array';
- const DISPOSITION_ATTACHMENT = 'attachment';
- const DISPOSITION_INLINE = 'inline';
- // members
- protected array $computedCacheControl;
- protected array $cookies;
- protected array $headerNames;
- // Inherited members from HeaderBag
- protected $headers;
- protected $cacheControl;
- // methods
- public void __construct()
- public void __toString()
- public array allPreserveCase()
- public void replace()
- public void set()
- public void remove()
- public void hasCacheControlDirective()
- public void getCacheControlDirective()
- public void setCookie()
- public void removeCookie()
- public array getCookies()
- public void clearCookie()
- public string makeDisposition()
- protected string computeCacheControlValue()
- // Inherited methods from HeaderBag
- public void __construct()
- public string __toString()
- public array all()
- public array keys()
- public void replace()
- public void add()
- public string|array get()
- public void set()
- public Boolean has()
- public Boolean contains()
- public void remove()
- public DateTime getDate()
- public void addCacheControlDirective()
- public void hasCacheControlDirective()
- public void getCacheControlDirective()
- public void removeCacheControlDirective()
- public ArrayIterator getIterator()
- public int count()
- protected void getCacheControlHeader()
- protected array parseCacheControl()
Hierarchy
Constants
Name | Value |
---|---|
COOKIES_FLAT | 'flat' |
COOKIES_ARRAY | 'array' |
DISPOSITION_ATTACHMENT | 'attachment' |
DISPOSITION_INLINE | 'inline' |
Members
protected
- $cacheControl
- $computedCacheControl — array
- $headerNames — array
- $headers
Methods
protected
- computeCacheControlValue() — Returns the calculated value of the cache-control header.
public
- __construct() — Constructor.
- __toString() — {@inheritdoc}
- allPreserveCase() — Returns the headers, with original capitalizations.
- clearCookie() — Clears a cookie in the browser
- getCacheControlDirective() — {@inheritdoc}
- getCookies() — Returns an array with all cookies
- hasCacheControlDirective() — {@inheritdoc}
- makeDisposition() — Generates a HTTP Content-Disposition field-value.
- remove() — {@inheritdoc}
- removeCookie() — Removes a cookie from the array, but does not unset it in the browser
- replace() — {@inheritdoc}
- set() — {@inheritdoc}
- setCookie() — Sets a cookie.
Inherited from Symfony\Component\HttpFoundation\HeaderBag
protected
- getCacheControlHeader()
- parseCacheControl() — Parses a Cache-Control HTTP header.
public
- __toString() — Returns the headers as a string.
- add() — Adds new headers the current HTTP headers set.
- addCacheControlDirective()
- all() — Returns the headers.
- contains() — Returns true if the given HTTP header contains the given value.
- count() — Returns the number of headers.
- get() — Returns a header value by name.
- getCacheControlDirective()
- getDate() — Returns the HTTP header value converted to a date.
- getIterator() — Returns an iterator for headers.
- has() — Returns true if the HTTP header is defined.
- hasCacheControlDirective()
- keys() — Returns the parameter keys.
- remove() — Removes a header.
- removeCacheControlDirective()
- replace() — Replaces the current HTTP headers by a new set.
- set() — Sets a header by name.