47 lines
1.7 KiB
Smarty
47 lines
1.7 KiB
Smarty
{extends file=$smarty.current_dir|cat:'/../extends.tpl'}
|
|
{use class="yii\helpers\Url"}
|
|
{use class="yii\grid\GridView"}
|
|
{use class="app\assets\UserAsset"}
|
|
{UserAsset::register($this)|void}
|
|
{block name='content'}
|
|
{if \Yii::$app->user->can("administrator")}
|
|
<div class="text-left">
|
|
<button class="btn btn-primary" onclick="user.form(this);" data-href="{Url::to(['/user/create'])}">
|
|
<i class="fa fa-plus"></i> Thêm mới
|
|
</button>
|
|
</div>
|
|
{/if}
|
|
<br>
|
|
{GridView::widget([
|
|
'dataProvider' => $dataProvider,
|
|
'filterModel' => $searchModel,
|
|
'layout'=> \app\helpers\UserGrid::getLayout(),
|
|
'tableOptions' => [
|
|
'class' => 'table table-striped table-bordered',
|
|
'style' => 'background:#fff;min-width:700px;'
|
|
],
|
|
'columns' => [
|
|
['class' => 'yii\grid\SerialColumn'],
|
|
'username',
|
|
'first_name',
|
|
[
|
|
'attribute'=>"roleName",
|
|
'format'=>'raw',
|
|
'value'=> \app\helpers\UserGrid::roles()
|
|
],
|
|
'phone_number',
|
|
'email',
|
|
[
|
|
'template'=> \app\helpers\UserGrid::actionTemplate(),
|
|
'class' => 'yii\grid\ActionColumn',
|
|
'contentOptions' => ['class' => 'text-center'],
|
|
'headerOptions' => ['style' => 'width:10%'],
|
|
'buttons'=>[
|
|
"view" => \app\helpers\UserGrid::view(),
|
|
"update" => \app\helpers\UserGrid::update(),
|
|
"delete" => \app\helpers\UserGrid::delete()
|
|
]
|
|
]
|
|
]
|
|
])}
|
|
{/block} |