Skip to content

Commit

Permalink
Merge pull request #486 from garak/runtime-service
Browse files Browse the repository at this point in the history
profit from the new Twig runtime
  • Loading branch information
garak authored Dec 25, 2024
2 parents c6e707c + ebf817f commit 5f85a49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
],
"require": {
"php": "^8.1",
"knplabs/knp-menu": "^3.3",
"knplabs/knp-menu": "^3.6",
"symfony/deprecation-contracts": "^2.5 | ^3.3",
"symfony/framework-bundle": "^5.4 | ^6.0 | ^7.0"
},
Expand Down
10 changes: 6 additions & 4 deletions config/twig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<parameters>
<parameter key="knp_menu.twig.extension.class">Knp\Menu\Twig\MenuExtension</parameter>
<parameter key="knp_menu.renderer.twig.class">Knp\Menu\Renderer\TwigRenderer</parameter>
<parameter key="knp_menu.renderer.twig.options" type="collection"></parameter>
</parameters>

<services>
<service id="knp_menu.twig.extension" class="%knp_menu.twig.extension.class%" public="false">
<service id="knp_menu.twig.extension" class="Knp\Menu\Twig\MenuExtension" public="false">
<tag name="twig.extension" />
</service>

<service id="knp_menu.twig.runtime" class="Knp\Menu\Twig\MenuRuntimeExtension" public="false">
<tag name="twig.runtime" />
<argument type="service" id="knp_menu.helper" />
<argument type="service" id="knp_menu.matcher" />
<argument type="service" id="knp_menu.manipulator" />
</service>

<service id="knp_menu.renderer.twig" class="%knp_menu.renderer.twig.class%">
<service id="knp_menu.renderer.twig" class="Knp\Menu\Renderer\TwigRenderer">
<tag name="knp_menu.renderer" alias="twig" />
<argument type="service" id="twig" />
<argument>%knp_menu.renderer.twig.template%</argument>
Expand Down

0 comments on commit 5f85a49

Please sign in to comment.