RouteDetailMenuLink.php
Same filename in other branches
Namespace
Drupal\devel\Plugin\MenuFile
-
src/
Plugin/ Menu/ RouteDetailMenuLink.php
View source
<?php
namespace Drupal\devel\Plugin\Menu;
use Drupal\Core\Menu\MenuLinkDefault;
use Drupal\Core\Url;
/**
* Modifies the menu link to add current route path.
*/
class RouteDetailMenuLink extends MenuLinkDefault {
/**
* {@inheritdoc}
*/
public function getOptions() {
$options = parent::getOptions();
$options['query']['path'] = '/' . Url::fromRoute('<current>')->getInternalPath();
return $options;
}
/**
* {@inheritdoc}
*/
public function getCacheMaxAge() {
return 0;
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
RouteDetailMenuLink | Modifies the menu link to add current route path. |