note files data

This commit is contained in:
Leorne
2019-12-05 17:03:00 +03:00
parent f7177975a8
commit 5ebdc16a8a
8 changed files with 64 additions and 5 deletions

View File

@ -1,6 +1,7 @@
<?php
use backend\modules\settings\models\AdditionalFields;
use mihaildev\elfinder\InputFile;
use unclead\multipleinput\MultipleInput;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
@ -36,12 +37,21 @@ use yii\widgets\ActiveForm;
'options' => ['prompt' => 'Выберите']
],
[
'name' => 'value',
'name' => 'value',
'title' => 'Значение',
'enableError' => true,
'type' => InputFile::className(),
'options' => [
'class' => 'input-priority'
]
'language' => 'ru',
'controller' => 'elfinder',
// вставляем название контроллера, по умолчанию равен elfinder
// фильтр файлов, можно задать массив фильтров https://github.com/Studio-42/elFinder/wiki/Client-con..
'name' => 'fields[value]',
'id' => 'fields-value',
'options' => ['class' => 'form-control itemImg', 'maxlength' => '255'],
'buttonOptions' => ['class' => 'btn btn-primary'],
'value' => $model->fields[0]['value'],
'buttonName' => 'Выбрать файл',
],
],
[
'name' => 'order',

0
backend/modules/notes/views/notes/index.php Normal file → Executable file
View File

0
backend/modules/notes/views/notes/update.php Normal file → Executable file
View File

8
backend/modules/notes/views/notes/view.php Normal file → Executable file
View File

@ -44,7 +44,13 @@ $this->params['breadcrumbs'][] = $this->title;
'field.name:text:Поле',
[
'attribute' => 'value',
'label' => 'Значение'
'format' => 'raw',
'value' => function ($model) {
if ($model->type_file == 'file') {
return $model->value . ' (' . Html::a('Скачать', $model->value, ['target' => '_blank', 'download' => 'download']) . ')';
}
return $model->value;
}
],
],
]); ?>