mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Added source menu
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
// src/Menu/Menu.php
|
||||
|
||||
namespace App\Menu;
|
||||
|
||||
use App\Event\Menu\Topbar\UserMenuEvent;
|
||||
@@ -9,6 +7,7 @@ use Knp\Menu\FactoryInterface;
|
||||
use Knp\Menu\ItemInterface;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use App\Event\Menu\Topbar\SourceMenuEvent;
|
||||
|
||||
class Menu
|
||||
{
|
||||
@@ -28,6 +27,19 @@ class Menu
|
||||
$this->factory = $factory;
|
||||
}
|
||||
|
||||
public function SourceNavbar(RequestStack $request): ItemInterface
|
||||
{
|
||||
$menu = $this->factory->createItem('root', [
|
||||
'childrenAttributes' => [
|
||||
'class' => 'navbar-nav mr-auto',
|
||||
],
|
||||
]);
|
||||
|
||||
$this->dispatcher->dispatch(SourceMenuEvent::EVENT, new SourceMenuEvent($this->factory, $menu, $request));
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
public function userTopbar(RequestStack $request): ItemInterface
|
||||
{
|
||||
$menu = $this->factory->createItem('root', [
|
||||
@@ -36,10 +48,7 @@ class Menu
|
||||
],
|
||||
]);
|
||||
|
||||
$this->dispatcher->dispatch(
|
||||
UserMenuEvent::EVENT,
|
||||
new UserMenuEvent($this->factory, $menu, $request)
|
||||
);
|
||||
$this->dispatcher->dispatch(UserMenuEvent::EVENT, new UserMenuEvent($this->factory, $menu, $request));
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
Reference in New Issue
Block a user