Contao\Controller::generateImage PHP Method

generateImage() public static method

Generate an image tag and return it as string
Deprecation: Deprecated since Contao 4.0, to be removed in Contao 5.0. Use Image::getHtml() instead.
public static generateImage ( string $src, string $alt = '', string $attributes = '' ) : string
$src string The image path
$alt string An optional alt attribute
$attributes string A string of other attributes
return string The image HTML tag
    public static function generateImage($src, $alt = '', $attributes = '')
    {
        @trigger_error('Using Controller::generateImage() has been deprecated and will no longer work in Contao 5.0. Use Image::getHtml() instead.', E_USER_DEPRECATED);
        return \Image::getHtml($src, $alt, $attributes);
    }