Yii::t('forms', 'Draft'), Form::STATUS_ACTIVE => Yii::t('forms', 'Active'), ]; } /** * @param $status * @return string * @throws Exception */ public static function statusName($status): string { return ArrayHelper::getValue(self::statusList(), $status); } /** * @param $status * @return string * @throws Exception */ public static function statusLabel($status): string { $class = match ($status) { Form::STATUS_DRAFT => 'label label-default', Form::STATUS_ACTIVE => 'label label-success', default => 'label label-default', }; return Html::tag('span', ArrayHelper::getValue(self::statusList(), $status), [ 'class' => $class, ]); } }