yii\helpers\BaseHtml::mailto PHP Méthode

mailto() public static méthode

Generates a mailto hyperlink.
public static mailto ( string $text, string $email = null, array $options = [] ) : string
$text string link body. It will NOT be HTML-encoded. Therefore you can pass in HTML code such as an image tag. If this is coming from end users, you should consider [[encode()]] it to prevent XSS attacks.
$email string email address. If this is null, the first parameter (link body) will be treated as the email address and used.
$options array the tag options in terms of name-value pairs. These will be rendered as the attributes of the resulting tag. The values will be HTML-encoded using [[encode()]]. If a value is null, the corresponding attribute will not be rendered. See [[renderTagAttributes()]] for details on how attributes are being rendered.
Résultat string the generated mailto link
    public static function mailto($text, $email = null, $options = [])
    {
        $options['href'] = 'mailto:' . ($email === null ? $text : $email);
        return static::tag('a', $text, $options);
    }