public function Request::setFormat

Associates a format with mime types.

@api

Parameters

string $format The format:

string|array $mimeTypes The associated mime types (the preferred one must be the first as it will be used as the content type):

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php, line 989

Class

Request
Request represents an HTTP request.

Namespace

Symfony\Component\HttpFoundation

Code

public function setFormat($format, $mimeTypes) {
  if (null === static::$formats) {
    static::initializeFormats();
  }
  static::$formats[$format] = is_array($mimeTypes) ? $mimeTypes : array(
    $mimeTypes,
  );
}