Answer the question
In order to leave comments, you need to log in
How to display images with a specific name in yii2-images?
Hello. Trying to use CostaRico yii2-images . It has a "name" field in the database, in the yii2-images settings this field is empty by default, but it is there.
All images attached to the model, I display like this:
$gallery = $product->getImages();
<?php foreach ($gallery as $img): ?>
<?= Html::img($img->getUrl, ['alt' => $product->name])?>
<?php endforeach;?>
$model->attachImage('../../image2.png', true, myname); //
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