add_download

This commit is contained in:
SoHardKI 2019-07-26 16:21:32 +03:00
parent e8adc409c0
commit 53eea4d130

View File

@ -72,21 +72,16 @@ $this->params['breadcrumbs'][] = $this->title;
'layout'=>"{items}",
'columns' => [
'field.name:text:Поле',
'value',
[
'label' => 'Download',
'attribute' => 'value',
'format' => 'raw',
'value' => function($model){
if ($model->type_file == 'file'){
return Html::a('Скачать', $model->value, ['target' => '_blank']);
return $model->value . ' (' . Html::a('Скачать', $model->value, ['target' => '_blank', 'download' => 'download']) . ')';
}
return null;
return $model->value;
}
],
],
]); ?>
<!-- --><?php //if ($model->fields[0]['type_file'] == 'file'): ?>
<!-- --><?//= Html::a('Скачать', $model->fields[0]['value'], ['target' => '_blank']); ?>
<!-- --><?php //endif; ?>
</div>