You are here

protected function EntityController::redirect in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/Controller/EntityController.php \Drupal\Core\Entity\Controller\EntityController::redirect()
  2. 10 core/lib/Drupal/Core/Entity/Controller/EntityController.php \Drupal\Core\Entity\Controller\EntityController::redirect()

Returns a redirect response object for the specified route.

Parameters

string $route_name: The name of the route to which to redirect.

array $route_parameters: (optional) Parameters for the route.

array $options: (optional) An associative array of additional options.

int $status: (optional) The HTTP redirect status code for the redirect. The default is 302 Found.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse A redirect response object that may be returned by the controller.

Overrides UrlGeneratorTrait::redirect

1 call to EntityController::redirect()
EntityController::addPage in core/lib/Drupal/Core/Entity/Controller/EntityController.php
Displays add links for the available bundles.

File

core/lib/Drupal/Core/Entity/Controller/EntityController.php, line 122

Class

EntityController
Provides the add-page and title callbacks for entities.

Namespace

Drupal\Core\Entity\Controller

Code

protected function redirect($route_name, array $route_parameters = [], array $options = [], $status = 302) {
  $options['absolute'] = TRUE;
  return new RedirectResponse(Url::fromRoute($route_name, $route_parameters, $options)
    ->toString(), $status);
}