Naming conventions:
Accept: audio/mp3; q=0.2; version=0.5, audio/basic+mp3
|------------------------------------------------------| header line
|------| field name
|-----------------------------------------------| field value
|-------------------------------| field value part
|------| type
|--| subtype
|--| format
|----| subtype
|---| format
|-------------------| parameter set
|-----------| parameter
|-----| parameter key
|--| parameter value
|---| priority
Methods
Factory method: parse Accept header string
fromString(string $headerLine) : \Zend\Http\Header\Accept
Parameters
$headerLine
string
Exceptions
Returns
Retrieve header name
getFieldName() : string
Inherited
inherited_from |
\Zend\Http\Header\HeaderInterface::getFieldName() |
Returns
string
Get field value
getFieldValue(array | null $values) : string
Parameters
$values
arraynull
Returns
string
getPrioritized()
getPrioritized() : array
Returns
array
with all the keys, values and parameters this header represents:
Match a media string against this header
match(array | string $matchAgainst) : \Zend\Http\Header\Accept\FieldValuePArt\AcceptFieldValuePart | bool
Parameters
$matchAgainst
arraystring
Returns
\Zend\Http\Header\Accept\FieldValuePArt\AcceptFieldValuePart
bool
The matched value or false
Cast to string
toString() : string
Inherited
Returns in form of "NAME: VALUE"
inherited_from |
\Zend\Http\Header\HeaderInterface::toString() |
Returns
string
Add a key/value combination to the internal queue
addFieldValuePartToQueue(\stdClass $value) : \Zend\Http\Header\number
Parameters
Returns
\Zend\Http\Header\number
Add a type, with the given priority
addType(string $type, int | float $priority, array $params) : \Zend\Http\Header\Accept
Parameters
$type
string
$priority
intfloat
$params
array
(optional) $params
Exceptions
Returns
Assemble and escape the field value parameters based on RFC 2616 section 2.1
assembleAcceptParam(string $value, string $key) : string
todo |
someone should review this thoroughly |
Parameters
$value
string
$key
string
Returns
string
Parse the keys contained in the header line
getParametersFromFieldValuePart(string $fieldValuePart) : array
Parameters
$fieldValuePart
string
Returns
array
Does the header have the requested type?
hasType(array | string $matchAgainst) : bool
Parameters
$matchAgainst
arraystring
Returns
bool
Return a match where all parameters in argument #1 match those in argument #2
matchAcceptParams(array $match1, array $match2) : bool | array
Parameters
$match1
array
$match2
array
Returns
bool
array
Parse the accept params belonging to a media range
parseFieldValuePart(string $fieldValuePart) : \stdClass
Parameters
$fieldValuePart
string
Returns
Sort the internal Field Value Parts
sortFieldValueParts() : \Zend\Http\Header\number
See |
sect 14.1 Media ranges can be overridden by more specific media ranges or specific media types. If more than one media range applies to a given type, the most specific reference has precedence. For example, Accept: text/*, text/html, text/html;level=1, * /* have the following precedence: 1) text/html;level=1 2) text/html 3) text/* 4) * /* |
Returns
\Zend\Http\Header\number
Properties
$regexAddType
$regexAddType
Determines if since last mutation the stack was sorted
$sorted : bool