stiti / nestedmenubundle
Nested Menu Symfony Bundle
1.0.x-dev
2016-11-03 10:28 UTC
Requires
- php: >=5.5.9
This package is not auto-updated.
Last update: 2024-09-23 13:01:29 UTC
README
欢迎使用 NestedMenuBundle - 一个用于创建嵌套菜单的 Symfony 扩展包
安装
步骤 1: 下载 Bundle
Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:
$ composer require stiti/nestedmenubundle 1.0.x-dev
Step 2: Enable the Bundle
Then, enable the bundle by adding the following line in the ````app/AppKernel.php````
file of your project:
~~~~~~~~~~~~~~~~~~~~~~~~~
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new NestedMenuBundle\NestedMenuBundle(),
);
// ...
}
// ...
}
Step 3: update schema
php bin/console doctrine:schema:update --force
~~~~~~~~~~~~~~~~~~~~~~~~~
Step 4: install assets
php bin/console assets:install
~~~~~~~~~~~~~~~~~~~~~~~~~
Step 5:foad Fixtures with DoctrineFixturesBundle
php bin/console doctrine:fixtures:load
Usage
In your template twig insert this code

{{ nestedMenu() }}
在您的项目中导入路由文件
nested_menu:
resource: "@NestedMenuBundle/Resources/config/routing.yml"
prefix: /
activate Serializer Component in config.yml
serializer: { enable_annotations: true }
管理菜单
http://MY_PROJECT/menuNested