You are here

protected function UrlGeneratorTrait::redirect in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Routing/UrlGeneratorTrait.php \Drupal\Core\Routing\UrlGeneratorTrait::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.

25 calls to UrlGeneratorTrait::redirect()
AccessDeniedSubscriber::onException in core/modules/user/src/EventSubscriber/AccessDeniedSubscriber.php
Redirects users when access is denied.
AggregatorController::feedRefresh in core/modules/aggregator/src/Controller/AggregatorController.php
Refreshes a feed, then redirects to the overview page.
AggregatorTestRssController::testRedirect in core/modules/aggregator/tests/modules/aggregator_test/src/Controller/AggregatorTestRssController.php
Generates a rest redirect to the test feed.
CommentController::redirectNode in core/modules/comment/src/Controller/CommentController.php
Redirects legacy node links to the new path.
CronController::runManually in core/modules/system/src/CronController.php
Run cron manually.

... See full list

File

core/lib/Drupal/Core/Routing/UrlGeneratorTrait.php, line 58
Contains \Drupal\Core\Routing\UrlGeneratorTrait.

Class

UrlGeneratorTrait
Wrapper methods for the Url Generator.

Namespace

Drupal\Core\Routing

Code

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