From 915cb6ba8deb9bb94e5c9038b62a7e6f18f08cb2 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Fri, 7 Jun 2019 01:49:01 +0800 Subject: [PATCH] Add generator service from menu bundle #222 --- catalyst/menu-bundle/Listener/MenuAnnotationListener.php | 5 ++--- config/services.yaml | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/catalyst/menu-bundle/Listener/MenuAnnotationListener.php b/catalyst/menu-bundle/Listener/MenuAnnotationListener.php index b6755e26..2ad6b04c 100644 --- a/catalyst/menu-bundle/Listener/MenuAnnotationListener.php +++ b/catalyst/menu-bundle/Listener/MenuAnnotationListener.php @@ -7,11 +7,10 @@ use ReflectionClass; use ReflectionException; use RuntimeException; use Symfony\Component\HttpKernel\Event\FilterControllerEvent; -use Catalyst\MenuBundle\Annotation\Menu as MenuAnnotation; use Twig\Environment as TwigEnvironment; -// TODO: put the generator in our bundle -use App\Menu\Generator as MenuGenerator; +use Catalyst\MenuBundle\Annotation\Menu as MenuAnnotation; +use Catalyst\MenuBundle\Menu\Generator as MenuGenerator; class MenuAnnotationListener { diff --git a/config/services.yaml b/config/services.yaml index 487d8d13..2fc3301d 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -119,6 +119,12 @@ services: $config_dir: "%kernel.root_dir%/../config" $acl_file: "%api_acl_file%" + Catalyst\MenuBundle\Menu\Generator: + arguments: + $router: "@router.default" + $cache_dir: "%kernel.cache_dir%" + $config_dir: "%kernel.root_dir%/../config" + Catalyst\MenuBundle\Listener\MenuAnnotationListener: arguments: $menu_name: "main_menu"