2017 © Pedro Peláez
 

symfony-bundle admin-bundle

Symfony VinceTAdminBundle

image

vincet/admin-bundle

Symfony VinceTAdminBundle

  • Sunday, September 15, 2013
  • by vincenttouzet
  • Repository
  • 2 Watchers
  • 2 Stars
  • 441 Installations
  • JavaScript
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

VinceTAdminBundle

This bundle extends the SonataAdminBundle and allow the possibility to manage the menu from other bundle., (*1)

See how to install and configure, (*2)

Manage menu

The SonataAdminBundle main menu (on top of all Admin pages) is generated with the list of Admin objects., (*3)

This bundle extends the menu and allows everyone to modify this menu., (*4)

The admin menu is generated with [KnpMenu][3] library. By default it retrieves all admin groups and labels Admin (like default menu renderer)., (*5)

To modify the admin menu juste create a listener :, (*6)


namespace VinceT\TestBundle\EventListener; class MenuListener { public function createMenu($event) { $menu = $event->getMenu(); // create a new groupe $menu->addChild('System', array('translationDomain'=>'MyDomain')); // move user to System group $users = $menu->pop('sonata_user'); $menu['System']->addChild($users); // add a divider to System group $menu['System']->addDivider(); // ad a nav header $menu['System']->addNavHeader('Informations'); // add About child $menu['System']->addChild('About', array('uri'=>'#')); // add children to About $menu['System']['About']->addChild('Symfony', array('uri'=>'http://symfony.com')); $menu['System']['About']->addChild( 'SonataAdminBundle', array( 'uri'=>'http://sonata-project.org/bundles/admin/master/doc/index.html' ) ); $menu['System']['About']->addChild('VinceTAdminBundle', array('uri'=>'')); } }

And just declare the listener in your services.yml file., (*7)

services:
    kernel.listener.admin_menu_listener:
        class: VinceT\TestBundle\EventListener\MenuListener
        tags:
            - { name: kernel.event_listener, event: admin.menu.create, method: createMenu }

This bundle use a custom MenuItem class VinceT\AdminBundle\Menu\MenuItem that extends the Knp\Menu\MenuItem. It add new functions (to add dividers, nav headers, ...), (*8)

The Versions

15/09 2013

dev-master

9999999-dev

Symfony VinceTAdminBundle

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

by Vincent Touzet

20/04 2013

2.1.x-dev

2.1.9999999.9999999-dev

Symfony VinceTAdminBundle

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

by Vincent Touzet