nucleos / menu-bundle
此包为 symfony 应用程序提供定义静态菜单的服务。
2.7.0
2024-08-14 17:25 UTC
Requires
- php: ^8.1
- knplabs/knp-menu: ^2.1 || ^3.1
- sonata-project/block-bundle: ^4.21 || ^5.0
- symfony/config: ^6.4 || ^7.0
- symfony/dependency-injection: ^6.4 || ^7.0
- symfony/expression-language: ^6.4 || ^7.0
- symfony/framework-bundle: ^6.4 || ^7.0
- symfony/http-kernel: ^6.4 || ^7.0
- symfony/translation-contracts: ^1.1 || ^2.0 || ^3.0
Requires (Dev)
- ergebnis/composer-normalize: ^2.0.1
- knplabs/knp-menu-bundle: ^2.3 || ^3.0
- symfony/browser-kit: ^6.4 || ^7.0
- symfony/translation: ^6.4 || ^7.0
- 2.8.x-dev
- 2.7.x-dev
- 2.7.0
- 2.6.x-dev
- 2.6.0
- 2.5.x-dev
- 2.5.0
- 2.4.x-dev
- 2.4.0
- 2.3.x-dev
- 2.3.0
- 2.2.x-dev
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.0
- 1.1.0
- 1.0.0
- 0.4.0
- 0.3.0
- 0.2.0
- 0.1.0
- dev-renovate/phpunit-phpunit-11.x
- dev-renovate/matthiasnoback-symfony-dependency-injection-test-6.x
- dev-readme-badge
- dev-renovate/phpunit-phpunit-10.x
This package is auto-updated.
Last update: 2024-09-14 19:47:43 UTC
README
此包为 symfony 应用程序提供定义静态菜单的服务。
安装
打开命令行控制台,进入你的项目目录,然后执行以下命令下载此包的最新稳定版本:
composer require nucleos/menu-bundle
启用包
然后,通过将其添加到 config/bundles.php
文件中注册的包列表来启用该包。
// config/bundles.php return [ // ... Nucleos\MenuBundle\NucleosMenuBundle::class => ['all' => true], ];
使用方法
创建一个名为 nucleos_menu.yaml
的配置文件。
# config/packages/nucleos_menu.yaml nucleos_menu: groups: // Header menu header: name: 'Header' attributes: id: 'header-nav' // Footer menu footer: name: 'Footer' // Main menu main: name: 'Main' attributes: class: 'nav navbar-nav' items: home: label: 'Home' icon: 'fa fa-home' route: 'app_home' routeParams: { path: '/' } downloads: label: 'Download' route: 'app_download_index' event: label: 'Event' route: 'app_event_index' // Submenu items children: venue: label: 'Venue' route: 'app_venue_index'
许可协议
此包遵循 MIT 许可协议。