diff --git a/application/src/Controller/DefaultController.php b/application/src/Controller/DefaultController.php
index bdf8718..6ccb204 100644
--- a/application/src/Controller/DefaultController.php
+++ b/application/src/Controller/DefaultController.php
@@ -17,7 +17,7 @@ class DefaultController extends AbstractController implements DefaultControllerI
*/
public function imprint(): Response
{
- return $this->render("standard/imprint.html.twig",['menu_items'=>[]]);
+ return $this->render("standard/imprint.html.twig");
}
/**
@@ -25,7 +25,7 @@ class DefaultController extends AbstractController implements DefaultControllerI
*/
public function homepage(): Response
{
- return $this->render("standard/homepage.html.twig",['menu_items'=>[]]);
+ return $this->render("standard/homepage.html.twig");
}
}
diff --git a/application/src/Controller/UserController.php b/application/src/Controller/UserController.php
index b17cc80..aa09860 100644
--- a/application/src/Controller/UserController.php
+++ b/application/src/Controller/UserController.php
@@ -17,7 +17,7 @@ class UserController extends AbstractController implements UserControllerInterfa
*/
public function logout(): Response
{
- return $this->render("user/login.html.twig",['menu_items'=>[]]);
+ return $this->render("user/login.html.twig");
}
/**
@@ -25,7 +25,7 @@ class UserController extends AbstractController implements UserControllerInterfa
*/
public function login(): Response
{
- return $this->render("user/login.html.twig",['menu_items'=>[]]);
+ return $this->render("user/login.html.twig");
}
/**
@@ -33,7 +33,6 @@ class UserController extends AbstractController implements UserControllerInterfa
*/
public function register(): Response
{
- return $this->render("user/register.html.twig",['menu_items'=>[]]);
+ return $this->render("user/register.html.twig");
}
-
}
\ No newline at end of file
diff --git a/application/src/Menu/Menu.php b/application/src/Menu/Menu.php
index aa15e69..008ba99 100644
--- a/application/src/Menu/Menu.php
+++ b/application/src/Menu/Menu.php
@@ -30,7 +30,11 @@ class Menu
public function userTopbar(RequestStack $request): ItemInterface
{
- $menu = $this->factory->createItem('root');
+ $menu = $this->factory->createItem('root', array(
+ 'childrenAttributes' => array(
+ 'class' => 'navbar-nav mr-auto',
+ ),
+ ));
$this->dispatcher->dispatch(
UserMenuEvent::EVENT,
diff --git a/application/src/Subscriber/UserMenuSubscriber.php b/application/src/Subscriber/UserMenuSubscriber.php
index a27048e..abbcb92 100644
--- a/application/src/Subscriber/UserMenuSubscriber.php
+++ b/application/src/Subscriber/UserMenuSubscriber.php
@@ -1,9 +1,5 @@
tokenStorage = $tokenStorage;
$this->translator = $translator;
}
-
- public function onUserMenuConfigure(UserMenuEvent $event)
+
+ public function onUserMenuConfigure(UserMenuEvent $event): void
{
$menu = $event->getItem();
- /** @var User $user */
- $user = $this->tokenStorage->getToken()->getUser();
-
- $dropdown = $menu->addChild(
- $this->translator->trans('Hello %username%', ['%username%' => 'Noname'], 'usermenu'),
- ['dropdown' => true]
+ $menu->addChild(
+ 'linking',
+ [
+ 'route' => 'homepage',
+ ]
);
-
+
+ $menu->addChild(
+ 'texting',
+ [
+ 'labelAttributes' => [
+ 'class' => 'class3 class4',
+ ],
+ ]
+ );
+
+ $dropdown = $menu->addChild(
+ 'Hello Me',
+ [
+ 'attributes' => [
+ 'dropdown' => true,
+ ],
+ ]
+ );
+
$dropdown->addChild(
- $this->translator->trans('Login', [], 'usermenu'),
- ['route' => 'user_login']
+ 'Profile',
+ [
+ 'route' => 'homepage',
+ 'attributes' => [
+ 'divider_append' => true,
+ ],
+ ]
+ );
+
+ $dropdown->addChild(
+ 'text',
+ [
+ 'attributes' => [
+ 'icon' => 'fa fa-user-circle',
+ ],
+ 'labelAttributes' => [
+ 'class' => ['class1', 'class2'],
+ ],
+ ]
+ );
+
+ $dropdown->addChild(
+ 'Logout',
+ [
+ 'route' => 'user_logout',
+ 'attributes' => [
+ 'divider_prepend' => true,
+ 'icon' => 'fa fa-sign-out',
+ ],
+ ]
);
}
-
+
public static function getSubscribedEvents(): array
{
return [
- UserMenuEvent::EVENT => 'onUserMenuConfigure',
+ UserMenuEvent::EVENT => 'onUserMenuConfigure'
];
}
-}
\ No newline at end of file
+}
diff --git a/application/templates/frames/default.html.twig b/application/templates/frames/default.html.twig
index ccde14b..60f05a8 100644
--- a/application/templates/frames/default.html.twig
+++ b/application/templates/frames/default.html.twig
@@ -1,7 +1,6 @@
{% extends "base.html.twig" %}
{% block body %}
-{% include 'frames/structure/navbar.html.twig' with menu_items %}
-{% include 'topbar.html.twig' %}
+{% include 'frames/structure/navbar.html.twig'%}