i have toggle switch in grid view
below is my code
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'title',
[
'attribute' => 'Activate ',
'format' => 'raw',
'value' => function ($model) {
return SwitchInput::widget([
'name' => $model->title,
'id'=>$model->title.$model->id,
'value'=>(!$model->status),
'pluginOptions' => [
'size' => 'medium',
'onColor' => 'success',
'offColor' => 'danger',
'onText'=>'activate',
'offText' => 'deactivate',
]
]);
},
],
[
'class' => 'yii\grid\ActionColumn',
'template'=>'{view}',
],
],
]); ?>
now i want to call controller action when i change activate to deactivate or vice versa,
i can do with js but i need to do this with yii2 method controller/action call
plz help me