I'm using Yii2 Framework. I have data on GridView and each row has a delete button. Here's my code:
'content'=>function($data){
return Html::a('<i class="glyphicon glyphicon-ban-circle"></i> Bekor qilish', ['delete'], ['class' => 'btn btn-danger', 'data-method'=>'post']);
I want post actionDelete to be fired when user clicks the button. My code isn't working, and it's giving me Error #400: Missing required parameters: id.
I found the following code that I believe from Yii v1:
echo CHtml::link("Delete", '#', array('submit'=>array('post/delete', "id"=>$data->id), 'confirm' => 'Are you sure you want to delete?'));
I want this very function for Yii2. I'm new to Yii Framework. Please, kindly help me.