if (!isset($this->buttons['delete'])) {
$this->buttons['delete' ] = function ($url, $model, $key) {
$options = array_merge([
'title' => Yii::t('yii', 'Delete'),
'aria-label' => Yii::t('yii', 'Delete'),
'data-confirm' => Yii::t('yii', 'Вы уверенный ?'),
'data-method' => 'get',
'data-pjax' => '0',
], $this->buttonOptions);
return Html::a('', $url, $options);
};
}
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
...
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view} {update} {mydelete}',
'buttons' => [
'mydelete' => function ($url,$model) {
return Html::a(
'удаляшка',
['/controller/delete', 'id'=>$model->id, 'second_hren'=>'hihichpock']);
},
],
],
],
]); ?>