E
E
Elsevar Rizayev2017-01-11 13:00:21
Yii
Elsevar Rizayev, 2017-01-11 13:00:21

How to upload files without using multi upload?

I have 6 fields each fileInputs [multi is not needed]
How to implement correctly?
doc looked. everything is ok with 1 file, but what if I have 6 fields? Make duplicates in the model for upload() and in the controller ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Максим Тимофеев, 2017-01-11
@EllPro

для 1 файла:
для нескольких:
плюс цикл
Ну а форма для кучи файлов такая:

<?= $form->field($model, 'myAttribute[]')->fileInput();?>
<?= $form->field($model, 'myAttribute[]')->fileInput();?>
<?= $form->field($model, 'myAttribute[]')->fileInput();?>
<?= $form->field($model, 'myAttribute[]')->fileInput();?>
<?= $form->field($model, 'myAttribute[]')->fileInput();?>
<?= $form->field($model, 'myAttribute[]')->fileInput();?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question