From 3e10a51c3a72f90b9ce307cbf30d1e753c91bc9a Mon Sep 17 00:00:00 2001 From: king199025 Date: Thu, 11 Oct 2018 14:52:44 +0300 Subject: [PATCH] fix config, grid view fix --- backend/config/main.php | 11 +++++++++++ backend/modules/card/views/user-card/index.php | 13 +++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/backend/config/main.php b/backend/config/main.php index 10ea3d8..df6ec1d 100644 --- a/backend/config/main.php +++ b/backend/config/main.php @@ -56,9 +56,20 @@ return [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ + '' => '/card/user-card' ], ], ], + 'as access' => [ + 'class' => 'yii\filters\AccessControl', + 'except' => ['site/login', 'site/error'], + 'rules' => [ + [ + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'params' => $params, ]; diff --git a/backend/modules/card/views/user-card/index.php b/backend/modules/card/views/user-card/index.php index 95741a2..6cfdf3e 100644 --- a/backend/modules/card/views/user-card/index.php +++ b/backend/modules/card/views/user-card/index.php @@ -2,6 +2,7 @@ use yii\helpers\Html; use yii\grid\GridView; +use yii\helpers\Url; /* @var $this yii\web\View */ /* @var $searchModel backend\modules\card\models\UserCardSearch */ @@ -22,10 +23,18 @@ $this->params['breadcrumbs'][] = $this->title; 'columns' => [ ['class' => 'yii\grid\SerialColumn'], - 'id', + //'id', + [ + 'label' => 'photo', + 'format' => 'raw', + 'value' => function($model){ + return Html::img(Url::to($model->photo),[ + 'style' => 'width:100px;' + ]); + }, + ], 'fio', 'passport', - 'photo', 'email:email', //'gender', //'dob',