fix config, grid view fix

This commit is contained in:
king199025 2018-10-11 14:52:44 +03:00
parent c3ce830284
commit 3e10a51c3a
2 changed files with 22 additions and 2 deletions

View File

@ -56,9 +56,20 @@ return [
'enablePrettyUrl' => true, 'enablePrettyUrl' => true,
'showScriptName' => false, 'showScriptName' => false,
'rules' => [ 'rules' => [
'' => '/card/user-card'
], ],
], ],
], ],
'as access' => [
'class' => 'yii\filters\AccessControl',
'except' => ['site/login', 'site/error'],
'rules' => [
[
'allow' => true,
'roles' => ['@'],
],
],
],
'params' => $params, 'params' => $params,
]; ];

View File

@ -2,6 +2,7 @@
use yii\helpers\Html; use yii\helpers\Html;
use yii\grid\GridView; use yii\grid\GridView;
use yii\helpers\Url;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $searchModel backend\modules\card\models\UserCardSearch */ /* @var $searchModel backend\modules\card\models\UserCardSearch */
@ -22,10 +23,18 @@ $this->params['breadcrumbs'][] = $this->title;
'columns' => [ 'columns' => [
['class' => 'yii\grid\SerialColumn'], ['class' => 'yii\grid\SerialColumn'],
'id', //'id',
[
'label' => 'photo',
'format' => 'raw',
'value' => function($model){
return Html::img(Url::to($model->photo),[
'style' => 'width:100px;'
]);
},
],
'fio', 'fio',
'passport', 'passport',
'photo',
'email:email', 'email:email',
//'gender', //'gender',
//'dob', //'dob',