= Html::encode($this->title) ?>
= Html::a(Yii::t('schema', 'Добавить стоп-слово'), Url::to(['create']), ['class' => 'btn btn-outline-primary btn-sm']) ?>
'schema-form', 'method' => 'get']); ?>
= $form->field($searchModel, 'name')->textInput() ?>
= $form->field($searchModel, 'type')->dropDownList(schema::getTypeList(), ['prompt' => Yii::t('schema', 'Все')]) ?>
= $form->field($searchModel, 'created_at')->widget(DatePicker::class, [
'language' => 'ru',
'containerOptions' => ['class' => 'form-group'],
'options' => ['class' => 'form-control'],
'dateFormat' => 'php:d.m.Y',
])->label() ?>
= Html::submitButton(Yii::t('schema', 'Фильтр'), ['class' => 'btn btn-sm btn-success']) ?>
= Html::a(Yii::t('schema', 'Отчистить фильтр'), Url::to(['/bad-word']), ['class' => 'btn btn-outline-dark btn-sm']) ?>
= GridView::widget([
'tableOptions' => ['class' => 'table table-striped table-bordered'],
'dataProvider' => $dataProvider,
'pager' => [
'firstPageLabel' => Yii::t('schema', 'В начало'),
'lastPageLabel' => Yii::t('schema', 'В конец'),
],
'columns' => [
['class' => yii\grid\SerialColumn::class],
'name',
[
'attribute' => 'type',
'value' => function ($model) {
return schema::getTypeList($model->type);
},
],
'created_at:date',
[
'class' => yii\grid\ActionColumn::class,
'template' => '{update}',
'buttons' => [
'update' => function ($url, $model, $key) {
return Html::a(Yii::t('schema', '{icon}', [
'icon' => HtmlHelper::ICON_UPDATE,
]), $url);
},
],
],
[
// todo ajax refactor
'class' => yii\grid\ActionColumn::class,
'template' => '{delete}',
'buttons' => [
'delete' => function ($url, $model, $key) {
return Html::a(Yii::t('schema', '{icon}', [
'icon' => HtmlHelper::ICON_DELETE,
]), $url, ['id' => "delete-bad-word-$model->id"]);
},
],
],
],
]) ?>