mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
integration of knp menu bundle
This commit is contained in:
@@ -2,27 +2,6 @@ parameters:
|
||||
# cl_chill_main.example.class: Chill\MainBundle\Example
|
||||
|
||||
services:
|
||||
chill.main.routes_loader:
|
||||
class: Chill\MainBundle\Routing\Loader\ChillRoutesLoader
|
||||
arguments:
|
||||
- "%chill_main.routing.resources%"
|
||||
tags:
|
||||
- { name: routing.loader }
|
||||
|
||||
chill.main.menu_composer:
|
||||
class: Chill\MainBundle\Routing\MenuComposer
|
||||
#must be set in function to avoid circular reference with chill.main.twig.chill_menu
|
||||
calls:
|
||||
- [setContainer, ["@service_container"]]
|
||||
|
||||
chill.main.twig.chill_menu:
|
||||
class: Chill\MainBundle\Routing\MenuTwig
|
||||
arguments:
|
||||
- "@chill.main.menu_composer"
|
||||
calls:
|
||||
- [setContainer, ["@service_container"]]
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
|
||||
twig_intl:
|
||||
class: Twig_Extensions_Extension_Intl
|
||||
|
23
Resources/config/services/routing.yml
Normal file
23
Resources/config/services/routing.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
services:
|
||||
chill.main.menu_composer:
|
||||
class: Chill\MainBundle\Routing\MenuComposer
|
||||
arguments:
|
||||
- '@Symfony\Component\Routing\RouterInterface'
|
||||
- '@Knp\Menu\FactoryInterface'
|
||||
Chill\MainBundle\Routing\MenuComposer: '@chill.main.menu_composer'
|
||||
|
||||
chill.main.routes_loader:
|
||||
class: Chill\MainBundle\Routing\Loader\ChillRoutesLoader
|
||||
arguments:
|
||||
- "%chill_main.routing.resources%"
|
||||
tags:
|
||||
- { name: routing.loader }
|
||||
|
||||
chill.main.twig.chill_menu:
|
||||
class: Chill\MainBundle\Routing\MenuTwig
|
||||
arguments:
|
||||
- "@chill.main.menu_composer"
|
||||
calls:
|
||||
- [setContainer, ["@service_container"]]
|
||||
tags:
|
||||
- { name: twig.extension }
|
@@ -24,8 +24,8 @@
|
||||
</a>
|
||||
</div>
|
||||
<ul class="submenu width-11-em">
|
||||
{% for route in routes %}
|
||||
<li><a href="{{ path(route.key, args ) }}" style="font-family: 'Open Sans'; font-weight:300; font-size: 0.9em;">{% if route.icon is defined %}<i class="fa fa-{{ route.icon }}"></i> {% endif %}{{ route.label|trans }}</a></li>
|
||||
{% for menu in menus %}
|
||||
<li><a href="{{ menu.uri }}" style="font-family: 'Open Sans'; font-weight:300; font-size: 0.9em;">{% if menu.extras.icon is defined %}<i class="fa fa-{{ menu.extras.icon }}"></i> {% endif %}{{ menu.label|trans }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user