You are here

interface RedirectDestinationInterface in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Routing/RedirectDestinationInterface.php \Drupal\Core\Routing\RedirectDestinationInterface

Provides an interface for redirect destinations.

Hierarchy

Expanded class hierarchy of RedirectDestinationInterface

All classes that implement RedirectDestinationInterface

6 files declare their use of RedirectDestinationInterface
CustomPageExceptionHtmlSubscriber.php in core/lib/Drupal/Core/EventSubscriber/CustomPageExceptionHtmlSubscriber.php
Contains \Drupal\Core\EventSubscriber\CustomPageExceptionHtmlSubscriber.
DefaultExceptionHtmlSubscriber.php in core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php
Contains \Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber.
MenuLinkAdd.php in core/modules/menu_ui/src/Plugin/Menu/LocalAction/MenuLinkAdd.php
Contains \Drupal\menu_ui\Plugin\Menu\LocalAction\MenuLinkAdd.
NodeListBuilder.php in core/modules/node/src/NodeListBuilder.php
Contains \Drupal\node\NodeListBuilder.
UserListBuilder.php in core/modules/user/src/UserListBuilder.php
Contains \Drupal\user\UserListBuilder.

... See full list

File

core/lib/Drupal/Core/Routing/RedirectDestinationInterface.php, line 13
Contains \Drupal\Core\Routing\RedirectDestinationInterface.

Namespace

Drupal\Core\Routing
View source
interface RedirectDestinationInterface {

  /**
   * 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 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 \Drupal\Core\EventSubscriber\RedirectResponseSubscriber::checkRedirectUrl()
   * @ingroup form_api
   */
  public function getAsArray();

  /**
   * Gets the destination as URL.
   *
   * @return string
   */
  public function get();

  /**
   * 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.
   *
   * @param string $new_destination
   *   The new destination.
   *
   * @return $this
   */
  public function set($new_destination);

}

Members

Namesort descending Modifiers Type Description Overrides
RedirectDestinationInterface::get public function Gets the destination as URL. 1
RedirectDestinationInterface::getAsArray public function Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url. 1
RedirectDestinationInterface::set public function Sets the destination as URL. 1