HeaderBag
class HeaderBag implements IteratorAggregate, Countable
HeaderBag is a container for HTTP headers.
Properties
protected | $headers | ||
protected | $cacheControl |
Methods
No description
Returns the headers as a string.
Returns the headers.
Returns the parameter keys.
Replaces the current HTTP headers by a new set.
Adds new headers the current HTTP headers set.
Returns a header value by name.
Sets a header by name.
Returns true if the HTTP header is defined.
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.
Removes a Cache-Control directive.
Returns an iterator for headers.
Returns the number of headers.
No description
Parses a Cache-Control HTTP 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.