Drupal 8  8.0.2
RedirectDestination Class Reference
Inheritance diagram for RedirectDestination:

Public Member Functions

 __construct (RequestStack $request_stack, UrlGeneratorInterface $url_generator)
 getAsArray ()
 get ()
 set ($new_destination)

Protected Attributes


Detailed Description

Provides helpers for redirect destinations.

Constructor & Destructor Documentation

__construct ( RequestStack  $request_stack,
UrlGeneratorInterface  $url_generator 

Constructs a new RedirectDestination instance.

\Symfony\Component\HttpFoundation\RequestStack$request_stackThe request stack.
\Drupal\Core\Routing\UrlGeneratorInterface$url_generatorThe URL generator.

References Drupal\requestStack(), and Drupal\urlGenerator().

Here is the call graph for this function:

Member Function Documentation

get ( )

{Gets the destination as URL.


Implements RedirectDestinationInterface.

References UrlHelper\buildQuery(), Drupal\destination(), UrlHelper\filterQueryParameters(), UrlHelper\isExternal(), Drupal\requestStack(), and Drupal\urlGenerator().

Here is the call graph for this function:

getAsArray ( )

{Prepares a 'destination' URL query parameter for use with .Used to direct the user back to the referring page after completing a form. By default the current URL is returned. If a destination exists in the current request, that destination is returned. As such, a destination can persist across multiple pages.

array An associative array containing the key:
  • destination: The value of the current request's 'destination' query parameter, if present. This can be either a relative or absolute URL. However, for security, redirection to external URLs is not performed. If the query parameter isn't present, then the URL of the current request is returned.
See Also

Implements RedirectDestinationInterface.

set (   $new_destination)

{Sets the destination as URL.This method should be used really rarely, for example views uses it, in order to override all destination calls in all of its rendering.

string$new_destinationThe new destination.

Implements RedirectDestinationInterface.

References Drupal\destination().

Here is the call graph for this function:

The documentation for this class was generated from the following file: