承接 vincet/admin-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vincet/admin-bundle

Composer 安装命令:

composer require vincet/admin-bundle

包简介

Symfony VinceTAdminBundle

README 文档

README

This bundle extends the SonataAdminBundle and allow the possibility to manage the menu from other bundle.

See how to install and configure

Manage menu

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

This bundle extends the menu and allows everyone to modify this menu.

The admin menu is generated with KnpMenu library. By default it retrieves all admin groups and labels Admin (like default menu renderer).

To modify the admin menu juste create a listener :

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.

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, ...)

统计信息

  • 总下载量: 685
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 1
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-01-21