Files

35 lines
558 B
PHP
Raw Permalink Normal View History

2026-08-31 11:33:59 +08:00
<?php
declare(strict_types=1);
namespace app\enum\web;
use core\interface\IEnum;
/**
* 菜单分类枚举
*/
enum MenuCategory: int implements IEnum
{
case NAV = 1; // 导航菜单
case MEMBER = 2; // 会员菜单
/**
* 获取文本
*/
public function text(): string
{
return match ($this) {
self::NAV => '导航菜单',
self::MEMBER => '会员菜单',
};
}
/**
* 获取标签
*/
public function label(): string
{
return $this->text();
}
}