1.1.7. Accept

The Request $accept property is a Sapien\Request\Header\Accept object.

The Accept object has these readonly ValueCollection properties:

  • TypeCollection $types: A collection of Accept\Type objects computed from $header['accept'].

  • CharsetCollection $charsets: A collection of Accept\Charset objects computed from $header['accept-charset'].

  • EncodingCollection $encodings: A collection of Accept\Encoding objects computed from $header['accept-encoding'].

  • LanguageCollection $languages: A collection of Accept\Language objects computed from $header['accept-language'].

Each collection is sorted from highest q parameter value to lowest.

Each Accept\* object has these readonly properties:

  • string $value: The main value of the accept header.

  • string $quality: The 'q=' parameter value.

  • array $params: A key-value array of all other parameters.

Each Accept\Language object has these additional readonly properties:

  • string $type: The language type.

  • ?string $subtype: The language subtype, if any.