class AcceptHeader
Represents an Accept-* header.
An accept header is compound with a list of items, sorted by descending quality.
__construct(array $items) | ||
static AcceptHeader | fromString(string $headerValue) Builds an AcceptHeader instance from a string. | |
string | __toString() Returns header value's string representation. | |
bool | has(string $value) Tests if header has given value. | |
AcceptHeaderItem|null | get(string $value) Returns given value's item, if exists. | |
$this | add(AcceptHeaderItem $item) Adds an item. | |
AcceptHeaderItem[] | all() Returns all items. | |
AcceptHeader | filter(string $pattern) Filters items on their value using given regex. | |
AcceptHeaderItem|null | first() Returns first item. |
array | $items |
Builds an AcceptHeader instance from a string.
string | $headerValue |
AcceptHeader |
Returns header value's string representation.
string |
Tests if header has given value.
string | $value |
bool |
Returns given value's item, if exists.
string | $value |
AcceptHeaderItem|null |
Adds an item.
AcceptHeaderItem | $item |
$this |
Returns all items.
AcceptHeaderItem[] |
Filters items on their value using given regex.
string | $pattern |
AcceptHeader |
Returns first item.
AcceptHeaderItem|null |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/HttpFoundation/AcceptHeader.html