You are here

public function NegotiationMiddleware::registerFormat in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php \Drupal\Core\StackMiddleware\NegotiationMiddleware::registerFormat()

Registers a format for a given MIME type.

Parameters

string $format: The format.

string $mime_type: The MIME type.

Return value

$this

File

core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php, line 65

Class

NegotiationMiddleware
Provides a middleware to determine the content type upon the accept header.

Namespace

Drupal\Core\StackMiddleware

Code

public function registerFormat($format, $mime_type) {
  $this->formats[$format] = $mime_type;
  return $this;
}