kosoukhov / yii2-labelwidget
Extension for Yii2 Framework to work with label bootstrap component.
Installs: 101
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Type:yii2-extension
Requires
- bower-asset/bootstrap: 3.3.* | 3.2.* | 3.1.*
- yiisoft/yii2: 2.0.*
- yiisoft/yii2-bootstrap: 2.0.*
This package is auto-updated.
Last update: 2024-11-13 17:58:51 UTC
README
LabelWidget renders an label bootstrap component.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist kosoukhov/yii2-labelwidget:dev-master
or add
"kosoukhov/yii2-labelwidget": "dev-master"
to the require section of your composer.json
file.
How to use
View:
<?php use kosoukhov\widget\LabelWidget; echo LabelWidget::widget([ 'condition' => 1, 'rules' => [ '1' => ['text' => 'Yes', 'class' => 'success'], '0' => ['text' => 'No', 'class' => 'danger'], ], ]); ?>
'class' must be in: default|primary|success|info|warning|danger