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

1.0.0 2016-03-31 13:12 UTC

This package is auto-updated.

Last update: 2024-11-13 17:58:51 UTC


README

LabelWidget renders an label bootstrap component.

Yii2 Latest Stable Version Total Downloads Latest Unstable Version License

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