dev-master
9999999-dev http://foreverglory.meSymfony MenuBundle
MIT
The Requires
by foreverglory
bundle symfony menu
Symfony MenuBundle
MenuBundle 基于 "knplabs/knp-menu-bundle" 进行菜单数据库存储, (*1)
添加 composer.json
到你的项目依赖, (*2)
{ "foreverglory/menu-bundle": "dev-master" }
添加 Kernel
依赖,并启用 Bundle
, (*3)
//app/AppKernel.php public function registerBundles() { return array( // ... new Knp\Bundle\MenuBundle\KnpMenuBundle(), new Glory\Bundle\MenuBundle\GloryMenuBundle(), // ... ); }
@see http://symfony.com/doc/master/bundles/KnpMenuBundle/index.html, (*4)
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: /
Symfony MenuBundle
MIT
bundle symfony menu