= $this->title ?>
= Html::a(''.' '. Yii::t('backend', 'Create'), ['create'],
['class' => 'btn btn-info d-none d-lg-block m-l-15 pull-right']) ?>
$dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => \yii\grid\SerialColumn::className()],
[
'attribute' => 'tax_name',
'filterInputOptions' => ['class' => 'form-control col-md-6'],
'value' => function (Tax $model) {
return $model->tax_name;
}
],
[
'attribute' => 'value',
'filterInputOptions' => ['class' => 'form-control col-md-6'],
'value' => function (Tax $model) {
return $model->value;
}
],
[
'attribute' => 'status',
'filter' => [Tax::ACTIVE => 'active', Tax::INACTIVE => 'Inactive'],
'filterInputOptions' => ['class' => 'select2 form-control col-md-6', 'prompt' => 'All'],
'format' => 'raw',
'value' => function (Tax $model) {
$id = Html::getInputId($model, 'status') . "-{$model->getPrimaryKey()}";
$html = Html::activeCheckbox($model, 'status',
['data-size'=> 'mini','data-toggle' => 'switch', 'label' => false, 'id' => $id]);
$html .= Html::tag('span', Html::label('', $id));
return Html::tag('div', $html, ['class' => 'bootstrap-switch']);
}
],
[
'class' => \yii\grid\ActionColumn::className(),
'header' => Yii::t('backend', 'Actions'),
'template' => '{update}{delete}',
'buttons' => [
'update' => function ($url, $model, $key) {
$html = Html::tag('span', '', ['class' => 'fa fa-pencil text-inverse m-r-10']);
return Html::a($html, $url);
},
'delete' => function ($url, $model, $key) {
$html = Html::tag('span', '', ['class' => 'fa fa-trash-o']);
return Html::a($html, $url, [
'data-pjax' => '0',
'data-confirm' => yii::t('backend', 'Are you sure you want to delete this item?'),
'data-method' => 'post'
]);
},
],
],
],
]); ?>