dispatcher = $dispatcher; $this->factory = $factory; } public function SourceNavbar(RequestStack $request): ItemInterface { $menu = $this->factory->createItem('root', [ 'childrenAttributes' => [ 'class' => 'navbar-nav mr-auto', ], ]); $this->dispatcher->dispatch(MenuEventType::SOURCE, new MenuEvent($this->factory, $menu, $request)); return $menu; } public function userTopbar(RequestStack $request): ItemInterface { $menu = $this->factory->createItem('root', [ 'childrenAttributes' => [ 'class' => 'navbar-nav mr-auto', ], ]); $this->dispatcher->dispatch(MenuEventType::USER, new MenuEvent($this->factory, $menu, $request)); return $menu; } }