mati-core / menu
Menu for Mati-core
v1.0.0
2021-02-24 08:48 UTC
Requires
- php: >=8.0
- baraja-core/package-manager: ~2.0
- nette/application: ^3.0
- nette/bootstrap: ^3.0
- nette/caching: ^3.0
- nette/di: ^3.0
- nette/neon: ^3.0
- nette/security: ^3.0
- nette/utils: ^3.0
Requires (Dev)
- nette/tester: ~2.0
- phpstan/phpstan: ^0.12
- phpstan/phpstan-nette: ^0.12.6
- roave/security-advisories: dev-master
- tracy/tracy: ^2.3
This package is auto-updated.
Last update: 2024-10-24 16:20:13 UTC
README
Install
Comoposer command:
composer require mati-core/menu
Setting
parameters: menu: menuName: group: menu-group-name position: 0 rights: - menu-right items: menuItemName: title: itemTitle icon: itemIcon route: ':Homepage:default' position: 0 badgeHandler: itemBadgeHandler rights: - item-right items: menuSubItemName: title: subItemTitle ...
Badge handler
<?php class MyBadgeHandler implements IMenuBadgeHandler { /** * @return array|MenuBadge[] */ public function getBadge(): array { $ret = []; $ret[] = new MenuBadge('Success', MenuBadge::TYPE_SUCCESS); $ret[] = new MenuBadge('Danger', MenuBadge::TYPE_DANGER); $ret[] = new MenuBadge('Info', MenuBadge::TYPE_INFO); $ret[] = new MenuBadge('Warning', MenuBadge::TYPE_WARNING); return $ret; } }