You are here

public function Request::setFormat in Zircon Profile 8

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

Associates a format with mime types.

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

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

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,
  );
}