Log in
Model

UrlBuilder

Magento\Catalog\Model\Product\Image\UrlBuilder

What it does

This class generates URLs for product images in Magento 2, handling both actual product images and placeholder images when no image is available.

Developers use this class when they need to programmatically build product image URLs for different display areas (like product listings, product detail pages, or thumbnails) without manually constructing the URL path.

It automatically applies the correct image dimensions and settings based on the display area configuration.

Public Methods

  • getUrl()