'只读', self::ReadingAndWriting => '读写', }; } /** * 转标签 */ public function toTag():AbstractHtmlElement { return match ($this){ self::ReadOnly => $this->getTag('success', 'light'), self::ReadingAndWriting => $this->getTag('warning', 'light'), }; } }