foreverglory / menu-bundle
Symfony MenuBundle
Installs: 23
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- knplabs/knp-menu-bundle: ~2.1
- php-kit/composer-bower-plugin: ~1.0
- symfony/symfony: ~2.3|~3.0
This package is not auto-updated.
Last update: 2024-11-09 20:07:08 UTC
README
MenuBundle 基于 "knplabs/knp-menu-bundle" 进行菜单数据库存储
介绍
Composer
添加 composer.json
到你的项目依赖
{ "foreverglory/menu-bundle": "dev-master" }
Kernel
添加 Kernel
依赖,并启用 Bundle
//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
Install
create Entity extend Glory\Bundle\MenuBundle\Entity\Menu
//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
#app/config/config.yml glory_menu: # The entity created earlier menu_class: AppBundle\Entity\Menu
configuration routing.yml
glory_menu: resource: "@GloryMenuBundle/Resources/config/routing.yml" prefix: /