2017 © Pedro Peláez
 

symfony-bundle menu-bundle

Symfony2 Bundle for managing menus with multiple sources

image

symedit/menu-bundle

Symfony2 Bundle for managing menus with multiple sources

  • Friday, June 17, 2016
  • by isometriks
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

SymEdit Menu Bundle

The main point of this bundle is to allow multiple other bundles to construct a single menu. The way this is done is by adding tags to the DI container and then running the root node of the menu through each of the builders., (*1)

This bundle also adds a way to run menu extension after the menu has been built which can allow you to remove nodes before the menu is rendered., (*2)

Registering a Builder

<service id="symedit_blog.symedit.menu" class="%symedit_blog.symedit.menu.class%">
    <tag name="symedit_menu.builder" menu="symedit_admin" priority="16" />
</service>

menu is required on the tag. If there are multiple tags with the same menu name then they will be built according to priority (higher priority means the that builder will execute first, default is 0)., (*3)

Extensions

Security Extension

You may add is_granted information to menu items and they will be removed if the user does not have these permissions:, (*4)

$menu->addChild('Label', array(
    'extras' => array(
        'is_granted' => 'ROLE_ADMIN'
    ),
));

Remove Empty Dropdowns

You can use remove_leaf to remove any dropdowns with no children. We suggest having a main menu builder run first to create each of the dropdowns that your other bundles may use so they won't have to check if they exist first and create them if not. This solves the problem of no other builders using that dropdown:, (*5)

$menu->addChild('Dropdown', array(
    'dropdown' => true, // From MopaBootstrapBundle
    'extras' => array(
        'remove_leaf' => true,
    ),
));

The Versions

17/06 2016

dev-master

9999999-dev

Symfony2 Bundle for managing menus with multiple sources

  Sources   Download

23/09 2015

v0.11

0.11.0.0

Symfony2 Bundle for managing menus with multiple sources

  Sources   Download

19/05 2015

v0.10.0

0.10.0.0

Symfony2 Bundle for managing menus with multiple sources

  Sources   Download