Version 1
[yaffs-website] / web / modules / contrib / devel / src / Plugin / Menu / RouteDetailMenuLink.php
1 <?php
2
3 namespace Drupal\devel\Plugin\Menu;
4
5 use Drupal\Core\Menu\MenuLinkDefault;
6 use Drupal\Core\Url;
7
8 /**
9  * Modifies the menu link to add current route path.
10  */
11 class RouteDetailMenuLink extends MenuLinkDefault {
12
13   /**
14    * {@inheritdoc}
15    */
16   public function getOptions() {
17     $options = parent::getOptions();
18     $options['query']['path'] = '/' . Url::fromRoute('<current>')->getInternalPath();
19     return $options;
20   }
21
22   /**
23    * {@inheritdoc}
24    */
25   public function getCacheMaxAge() {
26     return 0;
27   }
28
29 }