public function DestinationMenuLink::getOptions in Devel 4.x
Same name and namespace in other branches
- 8.3 src/Plugin/Menu/DestinationMenuLink.php \Drupal\devel\Plugin\Menu\DestinationMenuLink::getOptions()
- 8 src/Plugin/Menu/DestinationMenuLink.php \Drupal\devel\Plugin\Menu\DestinationMenuLink::getOptions()
- 8.2 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\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;
}