tokenStorage = $tokenStorage; $this->translator = $translator; } public function onUserMenuConfigure(UserMenuEvent $event): void { $menu = $event->getItem(); $menu->addChild( 'start', [ 'route' => 'homepage', 'attributes' => [ 'icon' => 'fab fa-font-awesome-flag', ], ] ); $menu->addChild( 'imprint', [ 'route'=>'imprint', 'attributes' => [ 'icon' => 'fas fa-address-card', ], ] ); $dropdown = $menu->addChild( 'user', [ 'attributes' => [ 'dropdown' => true, 'icon' => 'fas fa-user', ], ] ); $dropdown->addChild( 'login', [ 'route' => 'login', 'attributes' => [ 'divider_append' => true, 'icon' => 'fas fa-sign-in-alt', ], ] ); $dropdown->addChild( 'logout', [ 'route' => 'logout', 'attributes' => [ 'icon' => 'fas fa-sign-out-alt', ], ] ); $dropdown->addChild( 'register', [ 'route' => 'user_register', 'attributes' => [ 'divider_prepend' => true, 'icon' => 'fas fa-file-signature', ], ] ); } public static function getSubscribedEvents(): array { return [ UserMenuEvent::EVENT => 'onUserMenuConfigure' ]; } }