You are here

public function DestinationMenuLink::getOptions in Devel 8.3

Same name and namespace in other branches
  1. 8 src/Plugin/Menu/DestinationMenuLink.php \Drupal\devel\Plugin\Menu\DestinationMenuLink::getOptions()
  2. 8.2 src/Plugin/Menu/DestinationMenuLink.php \Drupal\devel\Plugin\Menu\DestinationMenuLink::getOptions()
  3. 4.x src/Plugin/Menu/DestinationMenuLink.php \Drupal\devel\Plugin\Menu\DestinationMenuLink::getOptions()

Returns the options for this link.

Return value

array An associative array of options.

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;
}