public function HttpKernel::setupSubrequest

Creates a request object for a subrequest.

Parameters

string $controller: The controller name (a string like BlogBundle:Post:index)

array $attributes: An array of request attributes.

array $query: An array of request query parameters.

Return value

\Symfony\Component\HttpFoundation\Request Returns the new request.

1 call to HttpKernel::setupSubrequest()
HttpKernel::forward in drupal/core/lib/Drupal/Core/HttpKernel.php
Forwards the request to another controller.

File

drupal/core/lib/Drupal/Core/HttpKernel.php, line 260
Definition of Drupal\Core\HttpKernel.

Class

HttpKernel
This HttpKernel is used to manage scope changes of the DI container.

Namespace

Drupal\Core

Code

public function setupSubrequest($controller, array $attributes, array $query) {

  // Don't override the controller if it's NULL.
  if (isset($controller)) {
    $attributes['_controller'] = $controller;
  }
  else {
    unset($attributes['_controller']);
  }
  return $this->container
    ->get('request')
    ->duplicate($query, NULL, $attributes);
}