Last active
October 2, 2015 14:21
-
-
Save tobiasfabian/4249557df71efb14be71 to your computer and use it in GitHub Desktop.
kirbytext: email with subject
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
kirbytext::$tags['email'] = array( | |
'attr' => array( | |
'text', | |
'subject' | |
), | |
'html' => function($tag) { | |
$email = $tag->attr('email'); | |
$text = $tag->attr('text', $email); | |
$subject = rawurlencode($tag->attr('subject',null)); | |
$query = ($subject) ? '?subject='.$subject : null; | |
return '<a href="mailto:'.$email.$query.'">'.$text.'</a>'; | |
} | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(email: [email protected] subject: reserve tickets) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment