Merge pull request #16 from apuc/add_holidays

add_download
This commit is contained in:
kavalar 2019-07-26 16:23:00 +03:00 committed by GitHub
commit 9daff7afb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,21 +72,16 @@ $this->params['breadcrumbs'][] = $this->title;
'layout'=>"{items}", 'layout'=>"{items}",
'columns' => [ 'columns' => [
'field.name:text:Поле', 'field.name:text:Поле',
'value',
[ [
'label' => 'Download', 'attribute' => 'value',
'format' => 'raw', 'format' => 'raw',
'value' => function($model){ 'value' => function($model){
if ($model->type_file == 'file'){ 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> </div>