kematjaya / menu-bundle
menu management
Installs: 1 867
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- kematjaya/url-bundle: ^7.0
- symfony/config: ^6.0|^7.0
- symfony/dependency-injection: ^6.0|^7.0
- symfony/framework-bundle: ^6.0|^7.0
- symfony/twig-bundle: ^6.0|^7.0
- symfony/yaml: ^6.0|^7.0
Requires (Dev)
- phpunit/phpunit: ^9.4
- symfony/browser-kit: ^6.0|^7.0
- symfony/var-dumper: ^6.0|^7.0
This package is auto-updated.
Last update: 2024-11-21 09:37:06 UTC
README
- installation
composer require kematjaya/menu-bundle
- configure to config/bundles.php
...
Kematjaya\MenuBundle\MenuBundle::class => ['all' => true]
...
- add to config/routes/annotations.yaml
...
kmj_menu:
resource: '@MenuBundle/Resources/config/router.xml'
...
- create file resources/menu.yaml for setting list of menu and insert menu like this:
dashboard: # Path name / route name
label: dashboard # label
icon: ft-home # css icon
group: null # group menu
kmj_menu_access_control_index: # Path name / route name
label: access_control # label
icon: ft-aperture # css icon
group: administrator # css icon
role: # role for allowed to access this menu
- ROLE_SUPER_USER
- ROLE_ADMINISTRATOR
- view menu in twig, add this to your twig template
{{ kmj_menu() }}
- url:
access control: kmj_menu_access_control_index
setting access control: kmj_menu_access_control_show