class ResponseHeaderBag extends HeaderBag
ResponseHeaderBag is a container for Response HTTP headers.
Constants
| COOKIES_FLAT |
|
| COOKIES_ARRAY |
|
| DISPOSITION_ATTACHMENT |
|
| DISPOSITION_INLINE |
|
Methods
|
__construct(array $headers = array())
Constructor. |
||
| string |
__toString()
Returns the headers as a string. |
|
| array |
allPreserveCase()
Returns the headers, with original capitalizations. |
|
|
replace(array $headers = array())
Replaces the current HTTP headers by a new set. |
||
|
set(string $key, string|array $values, Boolean $replace = true)
Sets a header by name. |
||
|
remove(string $key)
Removes a header. |
||
| hasCacheControlDirective($key) | ||
| getCacheControlDirective($key) | ||
|
setCookie(Cookie $cookie)
Sets a cookie. |
||
|
removeCookie(string $name, string $path = '/', string $domain = null)
Removes a cookie from the array, but does not unset it in the browser |
||
| array |
getCookies(string $format = self::COOKIES_FLAT)
Returns an array with all cookies |
|
|
clearCookie(string $name, string $path = '/', string $domain = null)
Clears a cookie in the browser |
||
| string |
makeDisposition(string $disposition, string $filename, string $filenameFallback = '')
Generates a HTTP Content-Disposition field-value. |
Details
at line 51
public
__construct(array $headers = array())
Constructor.
at line 63
public string
__toString()
Returns the headers as a string.
at line 80
public array
allPreserveCase()
Returns the headers, with original capitalizations.
at line 90
public
replace(array $headers = array())
Replaces the current HTTP headers by a new set.
at line 106
public
set(string $key, string|array $values, Boolean $replace = true)
Sets a header by name.
at line 127
public
remove(string $key)
Removes a header.
at line 142
public
hasCacheControlDirective($key)
at line 150
public
getCacheControlDirective($key)
at line 162
public
setCookie(Cookie $cookie)
Sets a cookie.
at line 176
public
removeCookie(string $name, string $path = '/', string $domain = null)
Removes a cookie from the array, but does not unset it in the browser
at line 204
public array
getCookies(string $format = self::COOKIES_FLAT)
Returns an array with all cookies
at line 235
public
clearCookie(string $name, string $path = '/', string $domain = null)
Clears a cookie in the browser
at line 254
public string
makeDisposition(string $disposition, string $filename, string $filenameFallback = '')
Generates a HTTP Content-Disposition field-value.