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