public function Request::get

Gets a "parameter" value.

This method is mainly useful for libraries that want to provide some flexibility.

Order of precedence: GET, PATH, POST, COOKIE

Avoid using this method in controllers:

  • slow
  • prefer to get from a "named" source

It is better to explicitly get request parameters from the appropriate public property instead (query, request, attributes, ...).

Parameters

string $key the key:

mixed $default the default value:

Boolean $deep is parameter deep in multidimensional array:

Return value

mixed

1 call to Request::get()
Request::getRequestFormat in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php
Gets the request format.

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php, line 527

Class

Request
Request represents an HTTP request.

Namespace

Symfony\Component\HttpFoundation

Code

public function get($key, $default = null, $deep = false) {
  return $this->query
    ->get($key, $this->attributes
    ->get($key, $this->request
    ->get($key, $default, $deep), $deep), $deep);
}