function Request::setFormat
Associates a format with mime types.
Parameters
string|string[] $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 1256
Class
- Request
- Request represents an HTTP request.
Namespace
Symfony\Component\HttpFoundationCode
public function setFormat(?string $format, string|array $mimeTypes) : void {
if (null === static::$formats) {
static::initializeFormats();
}
static::$formats[$format] = \is_array($mimeTypes) ? $mimeTypes : [
$mimeTypes,
];
}