You are here

public function NegotiationMiddleware::registerFormat in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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 68
Contains \Drupal\Core\StackMiddleware\NegotiationMiddleware.

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