From 53eea4d130c9af7a3d5226a2064ecb422d76f664 Mon Sep 17 00:00:00 2001 From: SoHardKI Date: Fri, 26 Jul 2019 16:21:32 +0300 Subject: [PATCH] add_download --- backend/modules/card/views/user-card/view.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/backend/modules/card/views/user-card/view.php b/backend/modules/card/views/user-card/view.php index 81f87a4..639c63e 100755 --- a/backend/modules/card/views/user-card/view.php +++ b/backend/modules/card/views/user-card/view.php @@ -72,21 +72,16 @@ $this->params['breadcrumbs'][] = $this->title; 'layout'=>"{items}", 'columns' => [ 'field.name:text:Поле', - 'value', [ - 'label' => 'Download', - 'format' => 'raw', - 'value' => function($model){ - if ($model->type_file == 'file'){ - return Html::a('Скачать', $model->value, ['target' => '_blank']); - } - return null; + 'attribute' => 'value', + 'format' => 'raw', + 'value' => function($model){ + if ($model->type_file == 'file'){ + return $model->value . ' (' . Html::a('Скачать', $model->value, ['target' => '_blank', 'download' => 'download']) . ')'; } + return $model->value; + } ], ], ]); ?> -fields[0]['type_file'] == 'file'): ?> -fields[0]['value'], ['target' => '_blank']); ?> - -