str::email($email, $text = false, $attr = array())

Generates an "a mailto" tag

  • $href (string)
    The url for the a tag
  • $text (mixed)
    The optional text. If null, the url will be used as text
  • $attr (array)
    Additional attributes for the tag
  • return (string)
    the generated html

Example

<?php
echo str::email('bastian@getkirby.com');
echo str::email('bastian@getkirby.com', 'mail me');

Result:

<a href="mailto:bastian@getkirby.com">bastian@getkirby.com</a>
<a href="mailto:bastian@getkirby.com">mail me</a>