Download the PHP package lch/menu-bundle without Composer
On this page you can find all versions of the php package lch/menu-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lch/menu-bundle
More information about lch/menu-bundle
Files in lch/menu-bundle
Package menu-bundle
Short Description Gives a simple Wordpress like menu management system for Symfony
License MIT
Homepage https://github.com/compagnie-hyperactive/MenuBundle
Informations about the package menu-bundle
MenuBundle
This provides a simple handling for menu items, based on Wordpress idea. You define menu locations, and then you retrieve menu items assigned on this location using a Twig extension.
For item editing part in BO, the bundle provides a MenuType
and CSS/JS part for drag-n drop feature.
This bundle is translatable, using lch/translatable-bundle.
Installation
composer require lch/menu-bundle "^1.1.8"
Configuration
After installing, create a lch_menu.yaml
in config/packages
. You can now defines your menus locations, for example :
Admin part
This is entirely up to you, but you have to use Lch\MenuBundle\Entity\Menu
class on you CRUD. CRUD example below :
Drag'n drop part
You must include CSS and JS components in your Webpack admin entrypoint :
Screenshots
Using code above, this can provide following presentation :
Menu item composition
Each menu item is composed with a title, a link and a field called technical tags. This last one is to be used for carrying any context you would latter need on presentation. This bundle provides only normalization stage on menu items, it up to the template to create presentation that suits to your needs.
note : in the screenshot above, technical tags carry an SVG icon name.
Menu retrieval
To get menus data, you must use get_menu_items
Twig extension :
All versions of menu-bundle with dependencies
symfony/framework-bundle Version ^4.2
knplabs/doctrine-behaviors Version ^2.0
lch/components-bundle Version ^1.2
twig/extensions Version ^1.5
symfony/translation Version 4.4.*