generated from liutk/owl-admin-base
31 lines
652 B
PHP
31 lines
652 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
enum AppOs: string
|
|
{
|
|
case Android = 'android';
|
|
case Ios = 'ios';
|
|
|
|
public function text(): string
|
|
{
|
|
return $this->options()[$this->value];
|
|
}
|
|
|
|
public static function options()
|
|
{
|
|
return [
|
|
self::Android->value => '安卓',
|
|
self::Ios->value => '苹果',
|
|
];
|
|
}
|
|
|
|
public static function labelMap(): array
|
|
{
|
|
return [
|
|
self::Android->value => '<span class="label bg-primary">'.self::Android->text().'</span>',
|
|
self::Ios->value => '<span class="label label-success">'.self::Ios->text().'</span>',
|
|
];
|
|
}
|
|
}
|