LanguageHeader

A parsed language header.

Delivers a more direct access to the individual elements of the header it represents

package

Default

Methods

__construct

__construct() 

Returns the country as reported by the HTTP client.

country() : string
deprecated

Response

string

variant

Test if this header is matched by matchTry header

isMatchedBy( $arg0) : boolean

Arguments

$arg0

ParsedHeaderValue

Response

boolean

true if this header represents a subset of matchTry, otherwise, false

Is this an allowed operation as specified by the corresponding header?

isPermitted() : boolean

Response

boolean

Returns the language as reported by the HTTP client.

language() : string
deprecated

Response

string

language

The value of the parameter specified by this key. Each is one of 3 things: <ol> <li>null &lt;- That key was not specified</li> <li>ParsedHeaderValue.EMPTY (tested using ==) &lt;- The value was not specified</li> <li>[Other] <- The value of the parameter</li> </ol> <b>Note:</b> The <code>q</code> parameter is never present.

parameter( $arg0) : string

Arguments

$arg0

string

Response

string

The parameters specified in this header value.

parameters() : array

Note: The q parameter is never present.

Response

array

Unmodifiable Map of parameters of this header value

Contains the raw value that was received from the user agent

rawValue() : string

Response

string

The subtag of the language as specified by <a href="https://tools.ietf.org/html/rfc7231#section-3.1.3.1">rfc7231#section-3.1.3.1</a>.<br> Equivalent to

subtag( $arg0 = null) : string

subtag()

A subtag of this language header.

param $level [integer] subtag($level)

Arguments

$arg0

integer

Response

string

The language subtag

subtagCount

subtagCount() : integer

Response

integer

the number of subtags this value has

The tag of the language as specified by <a href="https://tools.ietf.org/html/rfc7231#section-3.1.3.1">rfc7231#section-3.1.3.1</a>.<br> Equivalent to

tag() : string

Response

string

The language tag

Holds the unparsed value of the header.<br> For the most part, this is the content before the semi-colon (";")

value() : string

Response

string

Returns the variant as reported by the HTTP client.

variant() : string
deprecated

Response

string

variant

Holds the weight specified in the "q" parameter of the header.<br> If the parameter is not specified, 1.0 is assumed according to <a href="https://tools.ietf.org/html/rfc7231#section-5.3.1">rfc7231</a>

weight() : float

Response

float

An integer that represents the absolute order position of this header

weightedOrder() : integer

Response

integer

Constants

<quote>If no "q" parameter is present, the default weight is 1.</quote>

DEFAULT_WEIGHT
var

php文件只是为了写代码方便,常量的实际值请参考原java文件