Answer the question
In order to leave comments, you need to log in
How to store multiple images in a database?
I want to save several pictures in the database (Maximum 5)
There is a field for this:
?= $form->field($Form, 'images[]')->fileInput(['multiple' => true, 'accept' => 'image/*','id'=>'gallery-photo-add'])->label(false) ?>
$Form->images = UploadedFile::getInstances($Form,'images');
$Form->image_1 = $Form->images[0];
$Form->image_2 = $Form->images[1];
$Form->image_3 = $Form->images[2];
$Form->image_4 = $Form->images[3];
$Form->image_5 = $Form->images[4];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question