added upload files in additional fields
This commit is contained in:
@ -4,6 +4,7 @@ use kartik\select2\Select2;
|
||||
use unclead\multipleinput\MultipleInput;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use mihaildev\elfinder\InputFile;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\project\models\Project */
|
||||
@ -53,7 +54,7 @@ use yii\widgets\ActiveForm;
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<?= $form->field($model, 'fields')->widget(MultipleInput::class, [
|
||||
|
||||
'cloneButton' => true,
|
||||
'columns' => [
|
||||
[
|
||||
'name' => 'field_id',
|
||||
@ -71,8 +72,16 @@ use yii\widgets\ActiveForm;
|
||||
'name' => 'value',
|
||||
'title' => 'Значение',
|
||||
'enableError' => true,
|
||||
'type' => InputFile::class,
|
||||
'options' => [
|
||||
'class' => 'input-priority'
|
||||
'language' => 'ru',
|
||||
'controller' => 'elfinder',
|
||||
'name' => 'fields[value]',
|
||||
'id' => 'fields-value',
|
||||
'options' => ['class' => 'form-control itemImg', 'maxlength' => '255'],
|
||||
'buttonOptions' => ['class' => 'btn btn-primary'],
|
||||
'value' => $model->fields[0]['value'],
|
||||
'buttonName' => 'Выбрать файл',
|
||||
]
|
||||
],
|
||||
[
|
||||
|
@ -47,7 +47,14 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'layout' => "{items}",
|
||||
'columns' => [
|
||||
'field.name:text:Поле',
|
||||
'value',
|
||||
[
|
||||
'attribute' => 'value',
|
||||
'format' => 'raw',
|
||||
'label' => 'Значение',
|
||||
'value' => function ($model) {
|
||||
return $model->getValue();
|
||||
}
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
|
Reference in New Issue
Block a user