<?php
use \yii\helpers\Html;
use yii\grid\GridView;

/**
 * @var $this \common\modules\users\controllers\StopwordsAdminController
 * @var $dataProvider yii\data\ActiveDataProvider
 */
?>

<div class="analytics-school-manage">
    <h1><?= Html::encode($this->title); ?></h1>

    <p>
        <?= Html::a('Добавить стоп слово', ['create'], ['class' => 'btn btn-success']); ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            [
                'attribute' => 'active',
                'value' => function($model) {
                        return ($model->active==1) ? 'Активно' : 'Не активно';
                    }
            ],
            'word',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>
