function DestinationMenuLink::getOptions
Same name in other branches
- 8.x-1.x src/Plugin/Menu/DestinationMenuLink.php \Drupal\devel\Plugin\Menu\DestinationMenuLink::getOptions()
- 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\MenuCode
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;
}