\Zend\Http\Header\Exception\InvalidArgumentException
see \Zend\Http\Header\http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17

 Methods

__construct()

__construct($value, $mediaType) 

Parameters

$value

$mediaType

Factory method: create an object from a string representation

fromString(string $headerLine) : \Zend\Http\Header\self

Parameters

$headerLine

string

Exceptions

\Zend\Http\Header\Exception\InvalidArgumentException If the header does not match RFC 2616 definition.

Returns

\Zend\Http\Header\self

Get the content-type character set encoding, if any

getCharset() : null | string

Returns

nullstring

Get the field name

getFieldName() : string

Returns

string

Get the field value

getFieldValue() : string

Returns

string

Get the media type

getMediaType() : string

Returns

string

Get any additional content-type parameters currently set

getParameters() : array

Returns

array

Determine if the mediatype value in this header matches the provided criteria

match(array | string $matchAgainst) : string | bool

Parameters

$matchAgainst

arraystring

Returns

stringboolMatched value or false

Set the content-type character set encoding

setCharset(string $charset) : \Zend\Http\Header\self

Parameters

$charset

string

Returns

\Zend\Http\Header\self

Set the media type

setMediaType(string $mediaType) : \Zend\Http\Header\self

Parameters

$mediaType

string

Returns

\Zend\Http\Header\self

Set additional content-type parameters

setParameters(array $parameters) : \Zend\Http\Header\self

Parameters

$parameters

array

Returns

\Zend\Http\Header\self

Create a string representation of the header

toString() : string

Returns in form of "NAME: VALUE"

Returns

string

Assemble the value based on the media type and any available parameters

assembleValue() : string

Returns

string

Split a mediatype string into an object with the following parts:

getMediaTypeObjectFromString(string $string) : \stdClass

  • type
  • subtype
  • format

Parameters

$string

string

Returns

Split comma-separated media types into an array

splitMediaTypesFromString(string $criteria) : array

Parameters

$criteria

string

Returns

array

Validate the format

validateFormat(string $right, string $left) : bool

Validate that the right side format matches what the left side defines.

Parameters

$right

string

$left

string

Returns

bool

Validate a partial wildcard (i.e., string ending in '*')

validatePartialWildcard(string $right, string $left) : bool

Parameters

$right

string

$left

string

Returns

bool

Validate a subtype

validateSubtype(\stdClass $right, \stdClass $left) : bool

Parameters

$right

\stdClass

$left

\stdClass

Returns

bool

 Properties

 

$mediaType

$mediaType : string

 

$parameters

$parameters : array

 

$value

$value : string