Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MenuLinkAdd.php

function MenuLinkAdd::getOptions

Overrides LocalActionDefault::getOptions

File

core/modules/menu_ui/src/Plugin/Menu/LocalAction/MenuLinkAdd.php, line 59

Class

MenuLinkAdd
Modifies the 'Add link' local action to add a destination.

Namespace

Drupal\menu_ui\Plugin\Menu\LocalAction

Code

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