custom delete accesses

This commit is contained in:
glambertessa 2020-09-09 17:52:39 +03:00
parent e4febd6cb3
commit 966003adb0
2 changed files with 12 additions and 1 deletions

View File

@ -147,6 +147,8 @@ class AccessesController extends Controller
UserCardAccesses::deleteAll(['accesses_id' => $clean_id]);
Accesses::deleteAll(['id' => $clean_id]);
Yii::$app->session->setFlash('success', "Доступ удален");
return $this->redirect(['index']);
}

View File

@ -32,7 +32,16 @@ $this->params['breadcrumbs'][] = $this->title;
'link',
'project',
'info',
['class' => 'yii\grid\ActionColumn']
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view} {update} {delete}',
'buttons' => [
'delete' => function ($data) {
return Html::a("<span class='glyphicon glyphicon-trash' aria-hidden='true'></span>",
['/accesses/accesses/custom-delete', 'id' => $data]);
},
],
],
],
]);
?>