TYPO3  7.6
Uri/EmailViewHelper.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Fluid\ViewHelpers\Uri;
3 
4 /* *
5  * This script is part of the TYPO3 project - inspiring people to share! *
6  * *
7  * TYPO3 is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU General Public License version 2 as published by *
9  * the Free Software Foundation. *
10  * *
11  * This script is distributed in the hope that it will be useful, but *
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
13  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
14  * Public License for more details. *
15  * */
16 
20 
36 {
41  public function render($email)
42  {
43  return static::renderStatic(
44  array(
45  'email' => $email
46  ),
48  $this->renderingContext
49  );
50  }
51 
60  {
61  $email = $arguments['email'];
62 
63  if (TYPO3_MODE === 'FE') {
64  $emailParts = $GLOBALS['TSFE']->cObj->getMailTo($email, $email);
65  return reset($emailParts);
66  } else {
67  return 'mailto:' . $email;
68  }
69  }
70 }