| @@ 12-35 (lines=24) @@ | ||
| 9 | /** |
|
| 10 | * Class MenuSubscriber |
|
| 11 | */ |
|
| 12 | class MenuSubscriber implements EventSubscriberInterface |
|
| 13 | { |
|
| 14 | /** |
|
| 15 | * Returns an array of event names this subscriber wants to listen to. |
|
| 16 | * |
|
| 17 | * @return array The event names to listen to |
|
| 18 | */ |
|
| 19 | public static function getSubscribedEvents() |
|
| 20 | { |
|
| 21 | return [ |
|
| 22 | MenuEnum::MENU_MAIN => 'onConfigureMenu', |
|
| 23 | ]; |
|
| 24 | } |
|
| 25 | ||
| 26 | /** |
|
| 27 | * @param MenuEvent $event |
|
| 28 | */ |
|
| 29 | public function onConfigureMenu(MenuEvent $event) |
|
| 30 | { |
|
| 31 | $event->getCurrentItem()->addChild( |
|
| 32 | 'Changelog', |
|
| 33 | [ |
|
| 34 | 'route' => 'changelog.index', |
|
| 35 | ] |
|
| 36 | ); |
|
| 37 | } |
|
| 38 | } |
|
| @@ 12-36 (lines=25) @@ | ||
| 9 | /** |
|
| 10 | * Class MenuSubscriber |
|
| 11 | */ |
|
| 12 | class MenuSubscriber implements EventSubscriberInterface |
|
| 13 | { |
|
| 14 | /** |
|
| 15 | * Returns an array of event names this subscriber wants to listen to. |
|
| 16 | * |
|
| 17 | * @return array The event names to listen to |
|
| 18 | */ |
|
| 19 | public static function getSubscribedEvents() |
|
| 20 | { |
|
| 21 | return [ |
|
| 22 | MenuEnum::MENU_MAIN => 'onConfigureMainMenu', |
|
| 23 | ]; |
|
| 24 | } |
|
| 25 | ||
| 26 | /** |
|
| 27 | * @param MenuEvent $event |
|
| 28 | */ |
|
| 29 | public function onConfigureMainMenu(MenuEvent $event) |
|
| 30 | { |
|
| 31 | $event->getCurrentItem()->addChild( |
|
| 32 | 'field_notes', |
|
| 33 | [ |
|
| 34 | 'label' => 'Field-Notes', |
|
| 35 | 'route' => 'field_notes.index', |
|
| 36 | ] |
|
| 37 | ); |
|
| 38 | } |
|
| 39 | } |
|