2017 © Pedro Peláez
 

symfony-bundle menu-bundle

Symfony MenuBundle

image

foreverglory/menu-bundle

Symfony MenuBundle

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

MenuBundle

MenuBundle 基于 "knplabs/knp-menu-bundle" 进行菜单数据库存储, (*1)

介绍

Composer

添加 composer.json 到你的项目依赖, (*2)

{
    "foreverglory/menu-bundle": "dev-master"
}

Kernel

添加 Kernel 依赖,并启用 Bundle, (*3)

//app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Knp\Bundle\MenuBundle\KnpMenuBundle(),
        new Glory\Bundle\MenuBundle\GloryMenuBundle(),
        // ...
    );
}

KnpMenuBundle

@see http://symfony.com/doc/master/bundles/KnpMenuBundle/index.html, (*4)

Install

create Entity extend Glory\Bundle\MenuBundle\Entity\Menu, (*5)

//src\AppBundle\Entity\Menu
namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Glory\Bundle\MenuBundle\Entity\Menu as BaseMenu;

/**
 * @ORM\Table(name="menu")
 * @ORM\Entity
 */
class Menu extends BaseMenu
{
    //more code
}

configuration config.yml glory_menu.menu_class, (*6)

#app/config/config.yml
glory_menu:
    # The entity created earlier
    menu_class: AppBundle\Entity\Menu

configuration routing.yml, (*7)

glory_menu:
    resource: "@GloryMenuBundle/Resources/config/routing.yml"
    prefix:   /

The Versions

04/01 2017