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