Download the PHP package firestorm23/config-knp-menu-bundle without Composer
On this page you can find all versions of the php package firestorm23/config-knp-menu-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download firestorm23/config-knp-menu-bundle
More information about firestorm23/config-knp-menu-bundle
Files in firestorm23/config-knp-menu-bundle
Package config-knp-menu-bundle
Short Description Configure your knp menus with yaml files accross your project bundles
License MIT
Homepage https://github.com/jbouzekri/ConfigKnpMenuBundle
Informations about the package config-knp-menu-bundle
ConfigKnpMenuBundle
Introduction
This bundle provides a way to configure your knp menus in your bundles yml configuration.
For more information on knp menu, read :
This bundle was inspired by the OroNavigationBundle in oro crm.
Installation
You can use composer for installation.
Add the repository to the composer.json file of your project and run the update or install command.
Then enable it in your AppKernel.php with the KnpMenuBundle :
Documentation
In order to use this bundle, you must define your menu configuration in a navigation.yml file in your bundle.
Example :
It will configure a provider for knp menu factory. You can then use your my_mega_menu in twig as a classic knp menu :
Configuration
This is the available configuration definition for an item.
This configuration matches the methods available in the Knp Menu Item class
Menu security
Security context is injected in menu item provider.
For root menu item, display or hide it in your twig template. For children items, if you didn't add the roles key, they will be displayed. Else it will passed the array of key to the isGranted method and check if you have rights on the the item.
Issues
- tree sub configuration property : In the navigation.yml file, you must defined a tree key below your menu name. It provides another level to keep the first level item key after configuration parsing. If someone know how to remove it, let me know.