DotPlant2 CMS allows you to bind to the image of an entity (product, page, etc.) directly through the admin panel and to display images on the frontend uses the widget
app\modules\image\widgets\ObjectImageWidget
.
Widget can take the following parameters:
model
- model of the object for which you want to display the image (required)viewFile
- widget mapping filelimit
- limit the number of displayed imagesoffset
- displacement positionthumbnailOnDemand
- false or true, or not to display a thumbnailthumbnailWidth
иthumbnailHeight
- width and height of thumbnails respectivelyuseWatermark
- false or true, display watermark or not
Minimum call widget is as follows:
<?=
app\modules\image\widgets\ObjectImageWidget::widget(
[
'model' => $model,
]
)
?>