Craft\ImagerVariable::srcset PHP Method

srcset() public method

todo : Implement support for other descriptors
public srcset ( Array $images, string $descriptor = 'w' ) : string
$images Array
$descriptor string
return string
    public function srcset($images, $descriptor = 'w')
    {
        $r = '';
        foreach ($images as $image) {
            $r .= $image->getUrl() . ' ' . $image->getWidth() . 'w, ';
        }
        return substr($r, 0, strlen($r) - 2);
    }