/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/helpers/HtmlHelper.php
41 строка
1 KB
Developer
Initial commit
03 авг 2026, 17:43
03 авг 2026, 17:43
7433917
Код
Авторство
О чём код?
<?php namespace common\helpers; use yii\bootstrap\BaseHtml; /** * Набор вспомогательных функций для работы c HTML * * @author Dmitry E. Semenov <sde.tomsk@gmail.com> * @copyright Self (c) 2024 */ class HtmlHelper extends BaseHtml { /** * Encloses the given string within a CDATA tag. * @param string $text the string to be enclosed * @return string the CDATA tag with the enclosed content. */ public static function cdata($text) { return '<![CDATA[' . $text . ']]>'; } /** * @inheritdoc */ public static function mailto($text, $email = null, $options = []) { $email = ($email === null ? $text : $email); $string = 'document.write(\'<a href="mailto:' . $email . '" ' . static::renderTagAttributes($options) . '>' . $text . '</a>\');'; $js_encode = ''; for ($x = 0, $_length = strlen($string); $x < $_length; $x++) { $js_encode .= '%' . bin2hex($string[$x]); } return '<script type="text/javascript">eval(unescape(\'' . $js_encode . '\'))</script>'; } }