yii2-netdisk/views/user/_creIndex.php
Chenx221 dbecd54ad7
Web Authn(2.5/3)
实现用户信息前端的对webauthn的验证设备管理
*使用pjax动态刷新内容
2024-03-16 20:26:21 +08:00

38 lines
1.1 KiB
PHP

<?php
/** @var ActiveDataProvider $dataProvider */
use yii\bootstrap5\Html;
use yii\data\ActiveDataProvider;
use yii\grid\ActionColumn;
use yii\grid\GridView;
echo '<div id="pjax-container">';
echo GridView::widget([
'dataProvider' => $dataProvider,
'layout' => "{items}",
'columns' => [
[
'attribute' => 'name',
'label' => '设备名',
],
[
'attribute' => 'public_key_credential_id',
'label' => '公钥凭证ID',
],
[
'class' => ActionColumn::class,
'template' => '{delete}',
'buttons' => [
'delete' => function ($url, $model, $key) {
return Html::a('<i class="fa-solid fa-trash"></i>', ['credential-delete', 'id' => $model->id], [
'data' => [
'confirm' => '你确定要删除这个项目吗?',
'method' => 'post',
'pjax' => 1,
],
]);
},
],
],
],
]);
echo '</div>';