Creates an email (mailto:) anchor. Note that the title is not escaped, to allow HTML elements within links (images, etc).
echo HTML::mailto($address);
string Core_HTML::mailto( string $email [, string $title = null , array $attributes = null ] )
参数列表
参数 类型 描述 默认值 string
Email address to send to $title
string
Link text null $attributes
array
HTML anchor attributes null
string
public static function mailto($email, $title = null, array $attributes = null)
{
// Obfuscate email address
$email = HTML::email($email);
if ($title === null)
{
// Use the email address as the title
$title = $email;
}
return '<a href="mailto:' . $email . '"' . HTML::attributes($attributes) . '>' . $title . '</a>';
}