ResponseHeaderBag
class ResponseHeaderBag extends HeaderBag
ResponseHeaderBag is a container for Response HTTP headers.
Constants
COOKIES_FLAT |
|
COOKIES_ARRAY |
|
DISPOSITION_ATTACHMENT |
|
DISPOSITION_INLINE |
|
Properties
protected | $headers | from HeaderBag | |
protected | $cacheControl | from HeaderBag | |
protected | $computedCacheControl | ||
protected | $cookies | ||
protected | $headerNames |
Methods
No description
Returns the headers.
Replaces the current HTTP headers by a new set.
Returns a header value by name.
Sets a header by name.
Returns true if the given HTTP header contains the given value.
Removes a header.
Adds a custom Cache-Control directive.
Returns true if the Cache-Control directive is defined.
Returns a Cache-Control directive value by name.
Returns the headers, with original capitalizations.
No description
Removes a cookie from the array, but does not unset it in the browser.
Returns an array with all cookies.
Clears a cookie in the browser.
No description
Returns the calculated value of the cache-control header.
Details
string|string[]|null
get(string $key, string|null $default = null, bool $first = true)
Returns a header value by name.
bool
contains(string $key, string $value)
Returns true if the given HTTP header contains the given value.
DateTime|null
getDate(string $key, DateTime $default = null)
Returns the HTTP header value converted to a date.
removeCookie(string $name, string $path = '/', string $domain = null)
Removes a cookie from the array, but does not unset it in the browser.