Last active
February 15, 2020 08:46
-
-
Save woutsanders/79b3551f2c4f07ddaab3c74fa9aba132 to your computer and use it in GitHub Desktop.
Knp Menu Bundle with the Metronic Admin Theme 4 sidebar menu http://bit.ly/2bfd2JS Couldn't have done it without this earlier, successful, attempt for Twitter Bootstrap: https://gist.github.com/nateevans/9958390. Rendered example: http://imgur.com/a/9LfZq If you are going to use this, make sure you have a valid license for the template!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="page-sidebar navbar-collapse collapse"> | |
<!-- BEGIN SIDEBAR MENU --> | |
{{ knp_menu_render('main', { | |
'currentClass': 'active open', | |
'ancestorClass': 'active open' | |
}) }} | |
<!-- END SIDEBAR MENU --> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# KnpMenuBundle configuration parameters. | |
knp_menu: | |
# use "twig: false" to disable the Twig extension and the TwigRenderer | |
twig: | |
# Use custom template by default. | |
template: :Menu:knp_menu.html.twig | |
# if true, enables the helper for PHP templates | |
templating: false | |
# the renderer to use, list is also available by default | |
default_renderer: twig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" ?> | |
<container xmlns="http://symfony.com/schema/dic/services" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | |
<services> | |
<service id="app.menu_builder" class="AppBundle\Menu\MenuBuilder"> | |
<tag name="knp_menu.menu_builder" method="createMainMenu" alias="main"/> | |
<argument type="service" id="knp_menu.factory"/> | |
</service> | |
</services> | |
</container> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment