function DestinationMenuLink::getOptions

Same name in other branches
  1. 4.x src/Plugin/Menu/DestinationMenuLink.php \Drupal\devel\Plugin\Menu\DestinationMenuLink::getOptions()

Overrides MenuLinkBase::getOptions

File

src/Plugin/Menu/DestinationMenuLink.php, line 16

Class

DestinationMenuLink
Modifies the menu link to add destination.

Namespace

Drupal\devel\Plugin\Menu

Code

public function getOptions() {
    $options = parent::getOptions();
    // Append the current path as destination to the query string.
    $options['query']['destination'] = Url::fromRoute('<current>')->toString();
    return $options;
}