You are here

public function Request::getRequestFormat in Zircon Profile 8

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

Gets the request format.

Here is the process to determine the format:

  • format defined by the user (with setRequestFormat())
  • _format request parameter
  • $default

Parameters

string $default The default format:

Return value

string The request format

1 call to Request::getRequestFormat()
Request::duplicate in vendor/symfony/http-foundation/Request.php
Clones a request and overrides some of its parameters.

File

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

Class

Request
Request represents an HTTP request.

Namespace

Symfony\Component\HttpFoundation

Code

public function getRequestFormat($default = 'html') {
  if (null === $this->format) {
    $this->format = $this
      ->get('_format', $default);
  }
  return $this->format;
}