Closed nihaha closed 7 years ago
Do not quite get a question…
Likely issue is about $service->images
in you model… How is it defined? (might be you need to add type to you db query there)
Generally I would not recommend doing this way… Instead - you methods in behavior, like in sample from readme:
foreach($model->getBehavior('galleryBehavior')->getImages() as $image) {
echo Html::img($image->getUrl('medium'));
}
Yes, I've considered to tweak my query in the model but for some reason I thought that attached behavior will do the job. Thanks, will fix my output.
I have two models - products and services. For both I've configured galleryBehavior option accordingly:
and
Images are saving correctly - each gallery to its directory but when I try to display them in my views I get strange behavior: images will be loading without considering a type.
In my view I render the gallery as follows:
What is does is it loads all of the images with suited ownerId without noticing a type field.