Yii::t('banners', 'Self window'), Banner::TARGET_BLANK => Yii::t('banners', 'Blank window'), ]; } public static function targetName($target): string { return ArrayHelper::getValue(self::targetList(), $target); } public static function statusList(): array { return [ Banner::STATUS_DRAFT => Yii::t('banners', 'Draft'), Banner::STATUS_ACTIVE => Yii::t('banners', 'Active'), ]; } public static function statusName($status): string { return ArrayHelper::getValue(self::statusList(), $status); } public static function statusLabel($status): string { switch ($status) { case Banner::STATUS_DRAFT: $class = 'label label-default'; break; case Banner::STATUS_ACTIVE: $class = 'label label-success'; break; default: $class = 'label label-default'; } return Html::tag('span', ArrayHelper::getValue(self::statusList(), $status), [ 'class' => $class, ]); } }