Menu for Mati-core

v1.0.0 2021-02-24 08:48 UTC

This package is auto-updated.

Last update: 2024-10-24 16:20:13 UTC


README

Latest Stable Version Total Downloads Integrity check Latest Unstable Version License

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;
	}

}