function LocalActionWithDestination::getOptions

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Menu/LocalActionWithDestination.php \Drupal\Core\Menu\LocalActionWithDestination::getOptions()

Overrides LocalActionDefault::getOptions

File

core/lib/Drupal/Core/Menu/LocalActionWithDestination.php, line 41

Class

LocalActionWithDestination
Modifies the local action to add a destination.

Namespace

Drupal\Core\Menu

Code

public function getOptions(RouteMatchInterface $route_match) {
  $options = parent::getOptions($route_match);
  // Append the current path or destination to the query string.
  $options['query']['destination'] = $this->redirectDestination
    ->get();
  return $options;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.