PHP code example of kosoukhov / yii2-labelwidget

1. Go to this page and download the library: Download kosoukhov/yii2-labelwidget library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kosoukhov / yii2-labelwidget example snippets



use kosoukhov\widget\LabelWidget;

echo LabelWidget::widget([
    'condition' => 1,
        'rules' => [
            '1' => ['text' => 'Yes', 'class' => 'success'], 
            '0' => ['text' => 'No', 'class' => 'danger'],
        ],
]);