You are here

public function Request::getAcceptableContentTypes in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Request.php \Symfony\Component\HttpFoundation\Request::getAcceptableContentTypes()

Gets a list of content types acceptable by the client browser.

Return value

array List of content types in preferable order

File

vendor/symfony/http-foundation/Request.php, line 1643

Class

Request
Request represents an HTTP request.

Namespace

Symfony\Component\HttpFoundation

Code

public function getAcceptableContentTypes() {
  if (null !== $this->acceptableContentTypes) {
    return $this->acceptableContentTypes;
  }
  return $this->acceptableContentTypes = array_keys(AcceptHeader::fromString($this->headers
    ->get('Accept'))
    ->all());
}