Performs content-type negotiation on a Request object, by iterating over the accepted
types in sequence, from most preferred to least, and attempting to match each one against a
content type defined by Media::type(), until a match is found. If more than one defined
type matches for a given content type, they will be checked in the order they were added
(usually, this corresponds to the order they were defined in the application bootstrapping
process).
public static negotiate ( |
||
$request | The request which contains the details of the request to be content-negotiated. | |
리턴 | string | null | Returns the first matching type name, i.e. `'html'` or `'json'`. When no matching type is found returns `null`. |