guild/backend/modules/card/views/user-card/index.php

64 lines
1.9 KiB
PHP
Raw Normal View History

2018-10-11 11:15:09 +03:00
<?php
use yii\helpers\Html;
use yii\grid\GridView;
2018-10-11 14:52:44 +03:00
use yii\helpers\Url;
2018-10-11 11:15:09 +03:00
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\card\models\UserCardSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Профили';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-card-index">
<p>
<?= Html::a('Добавить', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
2018-10-11 14:52:44 +03:00
//'id',
[
'label' => 'photo',
'format' => 'raw',
'value' => function($model){
return Html::img(Url::to($model->photo),[
'style' => 'width:100px;'
]);
},
],
2018-10-11 11:15:09 +03:00
'fio',
2018-12-03 12:10:39 +03:00
//'passport',
'salary',
2018-10-11 11:15:09 +03:00
'email:email',
//'gender',
//'dob',
2018-11-23 16:09:29 +03:00
[
'attribute' => 'status',
'value' => function($model){
return $model->status0->name;
},
'filter' => kartik\select2\Select2::widget([
'model' => $searchModel,
'attribute' => 'status',
'data' => \common\models\Status::getStatusesArray(\common\models\UseStatus::USE_PROFILE),
'options' => ['placeholder' => 'Начните вводить...','class' => 'form-control'],
'pluginOptions' => [
'allowClear' => true
],
]),
],
2018-10-11 11:15:09 +03:00
//'created_at',
//'updated_at',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>