Answer the question
In order to leave comments, you need to log in
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 файла:
для нескольких:
плюс цикл
Ну а форма для кучи файлов такая:
<?= $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 questionAsk a Question
731 491 924 answers to any question