I want to hide Yii2 GridView Action Column buttons on the base of model field status. If status is = 1 then hide view button only. How I can?
Code:
In yii2 use return Url::to(['controler/action']);
altogether
[
'class' => 'kartik\grid\ActionColumn',
'template' => '{today_action}',
'buttons' => [
'today_action' => function ($url, $model) {
return Html::a('', $url,
[
'title' => Yii::t('app', 'Change today\'s lists'),
]);
}
],
'urlCreator' => function ($action, $model, $key, $index) {
if ($action === 'today_action') {
return Url::to(['customers/today']);
}
}
],
I am using kartik extension but works fine with yii