function RedirectDestinationInterface::getAsArray
Same name in other branches
- 9 core/lib/Drupal/Core/Routing/RedirectDestinationInterface.php \Drupal\Core\Routing\RedirectDestinationInterface::getAsArray()
- 10 core/lib/Drupal/Core/Routing/RedirectDestinationInterface.php \Drupal\Core\Routing\RedirectDestinationInterface::getAsArray()
- 11.x core/lib/Drupal/Core/Routing/RedirectDestinationInterface.php \Drupal\Core\Routing\RedirectDestinationInterface::getAsArray()
Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
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.
Return value
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
\Drupal\Core\EventSubscriber\RedirectResponseSubscriber::checkRedirectUrl()
Related topics
1 method overrides RedirectDestinationInterface::getAsArray()
- RedirectDestination::getAsArray in core/
lib/ Drupal/ Core/ Routing/ RedirectDestination.php - Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
File
-
core/
lib/ Drupal/ Core/ Routing/ RedirectDestinationInterface.php, line 29
Class
- RedirectDestinationInterface
- Provides an interface for redirect destinations.
Namespace
Drupal\Core\RoutingCode
public function getAsArray();
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.