public function HttpKernel::forward

Forwards the request to another controller.

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

Response A Response instance

File

drupal/core/lib/Drupal/Core/HttpKernel.php, line 72
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 forward($controller, array $attributes = array(), array $query = array()) {
  $attributes['_controller'] = $controller;
  $subRequest = $this->container
    ->get('request')
    ->duplicate($query, null, $attributes);
  return $this
    ->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
}