Zend\Http\Header\ContentType
Synopsis
class ContentType
implements
HeaderInterface
{
- // members
- protected string $mediaType;
- protected array $parameters;
- protected string $value;
- // methods
- public static self fromString()
- public void __construct()
- public string|bool match()
- public string toString()
- public string getFieldName()
- public string getFieldValue()
- public self setMediaType()
- public string getMediaType()
- public self setParameters()
- public array getParameters()
- public self setCharset()
- public null|string getCharset()
- protected string assembleValue()
- protected array splitMediaTypesFromString()
- protected stdClass getMediaTypeObjectFromString()
- protected bool validateSubtype()
- protected bool validateFormat()
- protected bool validatePartialWildcard()
Hierarchy
Implements
Members
protected
- $mediaType — string
- $parameters — array
- $value — string
Methods
protected
- assembleValue() — Assemble the value based on the media type and any available parameters
- getMediaTypeObjectFromString() — Split a mediatype string into an object with the following parts:
- splitMediaTypesFromString() — Split comma-separated media types into an array
- validateFormat() — Validate the format
- validatePartialWildcard() — Validate a partial wildcard (i.e., string ending in '*')
- validateSubtype() — Validate a subtype
public
- __construct()
- fromString() — Factory method: create an object from a string representation
- getCharset() — Get the content-type character set encoding, if any
- getFieldName() — Get the field name
- getFieldValue() — Get the field value
- getMediaType() — Get the media type
- getParameters() — Get any additional content-type parameters currently set
- match() — Determine if the mediatype value in this header matches the provided criteria
- setCharset() — Set the content-type character set encoding
- setMediaType() — Set the media type
- setParameters() — Set additional content-type parameters
- toString() — Create a string representation of the header