\Zend\Http\Header\Exception\InvalidArgumentException
see
package Default

 Methods

__construct()

__construct($value = null, $mediaType = null

Parameters

$value

$mediaType

Factory method: create an object from a string representation

fromString(string $headerLine) : \Zend\Http\Header\ContentType
Static
inherited_from \Zend\Http\Header\HeaderInterface::fromString()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$headerLine

string

Returns

\Zend\Http\Header\ContentType

Get the content-type character set encoding, if any

getCharset() : null | string

Returns

nullstring

Get the field name

getFieldName() : string
inherited_from \Zend\Http\Header\HeaderInterface::getFieldName()

Returns

string

Get the field value

getFieldValue() : string
inherited_from \Zend\Http\Header\HeaderInterface::getFieldValue()

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 | boolean

Parameters

$matchAgainst

arraystring

Returns

stringbooleanMatched value or false

Set the content-type character set encoding

setCharset(string $charset) : \Zend\Http\Header\ContentType
fluent This method is part of a fluent interface and will return the same instance

Parameters

$charset

string

Returns

\Zend\Http\Header\ContentType

Set the media type

setMediaType(string $mediaType) : \Zend\Http\Header\ContentType
fluent This method is part of a fluent interface and will return the same instance

Parameters

$mediaType

string

Returns

\Zend\Http\Header\ContentType

Set additional content-type parameters

setParameters(array $parameters) : \Zend\Http\Header\ContentType
fluent This method is part of a fluent interface and will return the same instance

Parameters

$parameters

array

Returns

\Zend\Http\Header\ContentType

Create a string representation of the header

toString() : string

Returns in form of "NAME: VALUE"

inherited_from \Zend\Http\Header\HeaderInterface::toString()

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

\stdClass

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) : boolean

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

Parameters

$right

string

$left

string

Returns

boolean

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

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

Parameters

$right

string

$left

string

Returns

boolean

Validate a subtype

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

Parameters

$right

\stdClass

$left

\stdClass

Returns

boolean

 Properties

 

$mediaType

$mediaType : string

Default

 

$parameters

$parameters : array

Default

array()
 

$value

$value : string

Default