EmailTemplate::setImage PHP Méthode

setImage() public méthode

Set the image property.
public setImage ( string $sourceUrl = '', string $linkUrl = '', string $alt = '' ) : EmailTemplate
$sourceUrl string The image source url.
$linkUrl string The href value of the image wrapper.
$alt string The alt value of the img tag.
Résultat EmailTemplate $this The calling object.
    public function setImage($sourceUrl = '', $linkUrl = '', $alt = '')
    {
        // We need either a source image or an alt to have an img tag.
        if ($sourceUrl || $alt) {
            $this->image = array('source' => htmlspecialchars($sourceUrl), 'link' => htmlspecialchars($linkUrl), 'alt' => $alt);
        }
        return $this;
    }