public static function defaultColumns() { return ['name' => ['class' => MainColumn::class, 'filterAttribute' => 'name_like', 'extraAttribute' => 'organization', 'format' => 'raw'], 'name_v' => ['class' => MainColumn::class, 'filterAttribute' => 'name_like', 'extraAttribute' => 'organization', 'format' => 'raw', 'value' => function ($model) { return CheckCircle::widget(['value' => $model->getVerification('name')->isVerified()]) . Html::a($model->name, ['@contact/view', 'id' => $model->id], ['class' => 'text-bold']); }], 'email_v' => ['format' => 'raw', 'attribute' => 'email', 'value' => function ($model) { return Html::mailto($model->email, $model->email) . CheckCircle::widget(['value' => $model->getVerification('email')->isVerified()]); }], 'voice_phone' => ['format' => 'raw', 'value' => function ($model) { return $model->voice_phone ? $model->voice_phone . CheckCircle::widget(['value' => $model->getVerification('voice_phone')->isVerified()]) : ''; }], 'fax_phone' => ['format' => 'raw', 'value' => function ($model) { return $model->fax_phone ? $model->fax_phone . CheckCircle::widget(['value' => $model->getVerification('fax_phone')->isVerified()]) : ''; }], 'email' => ['format' => 'raw', 'value' => function ($model) { $result = $model->email; if ($model->email_new) { $result .= '<br>' . Html::tag('b', Yii::t('hipanel:client', 'change is not confirmed'), ['class' => 'text-warning']); } if ($model->email_new !== $model->email) { $result .= '<br>' . Html::tag('span', $model->email_new, ['class' => 'text-muted']); } return $result; }], 'email_with_verification' => ['label' => Yii::t('hipanel', 'Email'), 'format' => 'raw', 'value' => function ($model) { $confirmation = $model->getVerification('email'); $result = $model->email; if (!$confirmation->isConfirmed()) { $result .= '<br>' . Html::tag('b', Yii::t('hipanel:client', 'change is not confirmed'), ['class' => 'text-warning']); $result .= '<br>' . Html::tag('span', $model->email_new, ['class' => 'text-muted']); } $result .= VerificationIndicator::widget(['model' => $confirmation]); return $result; }], 'country' => ['attribute' => 'country_name', 'format' => 'html', 'value' => function ($model) { return Html::tag('span', '', ['class' => 'flag-icon flag-icon-' . $model->country]) . ' ' . $model->country_name; }], 'street' => ['label' => Yii::t('hipanel:client', 'Street'), 'format' => 'html', 'value' => function ($model) { return $model->street1 . $model->street2 . $model->street3; }], 'street1' => ['attribute' => 'street1', 'format' => 'html', 'value' => function ($model) { return Html::tag('span', $model->street1, ['class' => 'bold']); }], 'street2' => ['attribute' => 'street2', 'format' => 'html', 'value' => function ($model) { return Html::tag('span', $model->street2, ['class' => 'bold']); }], 'street3' => ['attribute' => 'street3', 'format' => 'html', 'value' => function ($model) { return Html::tag('span', $model->street3, ['class' => 'bold']); }], 'other' => ['attribute' => 'other_messenger'], 'messengers' => ['format' => 'html', 'label' => Yii::t('hipanel:client', 'Messengers'), 'value' => function ($model) { $res = []; foreach (['skype' => 'Skype', 'icq' => 'ICQ', 'jabber' => 'Jabber'] as $k => $label) { if ($model->{$k}) { $res[] = "<b>{$label}:</b> " . $model->{$k}; } } return implode('<br>', $res); }], 'social_net' => ['format' => 'html', 'value' => function ($model) { return Html::a($model->social_net, $model->social_net); }], 'birth_date' => ['format' => 'date'], 'passport_date' => ['format' => 'date'], 'actions' => ['class' => MenuColumn::class, 'menuClass' => ContactActionsMenu::class], 'vat_rate' => ['value' => function ($model) { return $model->vat_rate ? (int) $model->vat_rate . '%' : null; }], 'reg_data' => ['format' => 'html', 'value' => function ($model) { return nl2br($model->reg_data); }]]; }
public function run() { if ($this->encode) { $this->text = Html::encode($this->text); } if (!$this->minimal) { $maxOembedCount = 3; // Maximum OEmbeds $oembedCount = 0; // OEmbeds used $that = $this; $this->text = preg_replace_callback('/(https?:\\/\\/.*?)(\\s|$)/i', function ($match) use(&$oembedCount, &$maxOembedCount, &$that) { if ($that->edit) { return Html::a($match[0], Html::decode($match[0]), array('target' => '_blank')); } // Try use oembed if ($maxOembedCount > $oembedCount) { $oembed = UrlOembed::GetOembed($match[0]); if ($oembed) { $oembedCount++; return $oembed; } } return Html::a($match[1], Html::decode($match[1]), array('target' => '_blank')) . $match[2]; }, $this->text); // mark emails $this->text = preg_replace_callback('/[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*(\\.[a-zA-Z]{2,3})/', function ($match) { return Html::mailto($match[0]); }, $this->text); } // get user and space details from guids $this->text = self::translateMentioning($this->text, $this->minimal ? false : true); // create image tag for emojis $this->text = self::translateEmojis($this->text, $this->minimal ? false : true); if ($this->maxLength != 0) { $this->text = \humhub\libs\Helpers::truncateText($this->text, $this->maxLength); } $output = nl2br($this->text); $this->trigger(self::EVENT_BEFORE_OUTPUT, new ParameterEvent(['output' => &$output])); return $output; }
<address> <h5><?php echo Yii::t('c/radiata/contact', 'Head Office'); ?> </h5> <p><?php echo Yii::t('c/radiata/contact', 'Address'); ?> </p> <p><?php echo Yii::t('c/radiata/contact', 'E-Mail:'); ?> <?php echo Html::mailto(Yii::t('c/radiata/contact', 'email'), Yii::t('c/radiata/contact', 'email')); ?> </p> </address> </li> </ul> </div> </div> </div> </div> </section> <!--/gmap_area --> <section id="contact-page"> <div class="container"> <div class="row"> <div class="col-lg-5">
<?php use yii\grid\GridView; use yii\helpers\Html; /* @var $this yii\web\View */ ?> <h1><?php echo sprintf("%s %s", Html::encode($event->name), Html::encode($team->name)); ?> shifts</h1> <p><strong>Contact:</strong> <?php echo Html::mailto($team->contact, $team->contact); ?> </p> <p><?php echo Yii::$app->formatter->asHtml($team->description); ?> </p> <?php foreach ($days as $timestamp => $dp) { ?> <h3><?php echo date('l, M j, Y', $timestamp); ?> </h3> <?php echo GridView::widget(['dataProvider' => $dp, 'columns' => ['title', ['label' => 'Time', 'attribute' => 'start_time', 'format' => 'text', 'value' => function ($model) { $start = date('g:i a', $model->start_time); $end = date('g:i a', $model->start_time + $model->length * 3600); return sprintf("%s - %s (%u hours)", $start, $end, $model->length); }], ['attribute' => 'volunteerList', 'format' => 'raw']]]);
jQuery(\'#banUrl\').attr(\'href\', button.data(\'url\')); });', View::POS_READY, 'bootstrap-modal-ban'); $this->registerJs('jQuery(\'#podiumModalUnBan\').on(\'show.bs.modal\', function(e) { var button = jQuery(e.relatedTarget); jQuery(\'#unbanUrl\').attr(\'href\', button.data(\'url\')); });', View::POS_READY, 'bootstrap-modal-unban'); echo $this->render('/elements/admin/_navbar', ['active' => 'members']); ?> <br> <?php Pjax::begin(); echo PageSizer::widget(); echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'filterSelector' => 'select#per-page', 'tableOptions' => ['class' => 'table table-striped table-hover'], 'columns' => [['attribute' => 'id', 'label' => Yii::t('podium/view', 'ID') . Helper::sortOrder('id'), 'encodeLabel' => false, 'contentOptions' => ['class' => 'col-sm-1 text-right'], 'headerOptions' => ['class' => 'col-sm-1 text-right']], ['attribute' => 'username', 'label' => Yii::t('podium/view', 'Username') . Helper::sortOrder('username'), 'encodeLabel' => false], ['attribute' => 'email', 'label' => Yii::t('podium/view', 'E-mail') . Helper::sortOrder('email'), 'encodeLabel' => false, 'format' => 'raw', 'value' => function ($model) { return Html::mailto($model->email); }], ['attribute' => 'role', 'label' => Yii::t('podium/view', 'Role') . Helper::sortOrder('role'), 'encodeLabel' => false, 'filter' => User::getRoles(), 'value' => function ($model) { return Yii::t('podium/view', ArrayHelper::getValue(User::getRoles(), $model->role)); }], ['attribute' => 'status', 'label' => Yii::t('podium/view', 'Status') . Helper::sortOrder('status'), 'encodeLabel' => false, 'filter' => User::getStatuses(), 'value' => function ($model) { return Yii::t('podium/view', ArrayHelper::getValue(User::getStatuses(), $model->status)); }], ['class' => ActionColumn::className(), 'header' => Yii::t('podium/view', 'Actions'), 'contentOptions' => ['class' => 'text-right'], 'headerOptions' => ['class' => 'text-right'], 'template' => '{view} {pm} {ban} {delete}', 'buttons' => ['view' => function ($url) { return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, ['class' => 'btn btn-default btn-xs', 'data-toggle' => 'tooltip', 'data-placement' => 'top', 'title' => Yii::t('podium/view', 'View Member')]); }, 'pm' => function ($url, $model) { if ($model->id !== Yii::$app->user->id) { return Html::a('<span class="glyphicon glyphicon-envelope"></span>', ['messages/new', 'user' => $model->id], ['class' => 'btn btn-default btn-xs', 'data-toggle' => 'tooltip', 'data-placement' => 'top', 'title' => Yii::t('podium/view', 'Send Message')]); } else { return Html::a('<span class="glyphicon glyphicon-envelope"></span>', '#', ['class' => 'btn btn-xs disabled text-muted']); } }, 'ban' => function ($url, $model) { if ($model->id !== Yii::$app->user->id) { if ($model->status !== User::STATUS_BANNED) {
<?php /** * @var \common\components\View $this * @var \app\modules\main\models\Review $model */ use yii\helpers\Html; use yii\helpers\ArrayHelper; use kartik\rating\StarRating; echo Html::beginTag('div', ['class' => 'review-item', 'id' => "comment-item-{$model->id}"]); echo Html::beginTag('div', ['class' => 'review-info']); echo Html::tag('span', $model->username, ['class' => 'review-username']); if (!empty($model->email)) { echo ' | '; echo Html::mailto($model->email, null, ['class' => 'review-email']); } echo ' | '; echo Html::tag('span', Yii::$app->formatter->asDatetime($model->created_at), ['class' => 'review-date']); echo Html::endTag('div'); $options = ArrayHelper::merge($model->metaFields->rating->inputClass['widgetOptions'], ['name' => "review-rating-{$model->id}", 'value' => $model->rating, 'readonly' => true, 'pluginOptions' => ['size' => 'xs']]); echo Html::tag('div', StarRating::widget($options), ['class' => 'review-rating']); echo Html::tag('div', $model->text, ['class' => 'review-text']); echo Html::endTag('div');
<?php use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $name string */ /* @var $message string */ /* @var $exception Exception */ $this->title = Yii::t('app', 'Error'); $email = Html::mailto(Yii::t('app', 'contact us'), Yii::$app->settings->emailMain); ?> <div class="site-error"> <?php if (isset($exception->statusCode) && $exception->statusCode === 404) { ?> <h3><?php echo Yii::t('app', 'Page not found'); ?> </h3> <?php } else { ?> <div class="alert alert-danger"> <?php echo nl2br(Html::encode($message)); ?> </div> <?php } ?> <p class="text-muted">
?> </h1> <table class="table table-striped table-bordered detail-view"> <tbody> <tr> <th width="300">Аватар</th> <td><?php echo drawImage($user->getAvatar(true)); ?> </td> </tr> <tr> <th>Email</th> <td><?php echo Html::mailto($user->getEmail()); ?> </td> </tr> <tr> <th>Имя</th> <td>Дмитрий</td> </tr> <tr> <th>Фамилия</th> <td>Мухортов</td> </tr> <tr> <th>Отчество</th> <td></td> </tr>
$post = ['title' => 'this is title', 'name' => 'this is name', 'child' => [1000, 200]]; echo Html::getInputName($model, 'username'); echo Html::getAttributeValue($model, 'username'); echo Html::tag('hr'); echo Html::getInputId($model, 'username'); echo Html::tag('hr'); ?> <?php echo Html::style('.username{color:red;font-size:8px;}'); echo Html::script('alert("script is test")', ['defer' => true]); echo Html::tag('br/'); echo Html::cssFile('@web/css/ie5.css', ['condition' => 'IE 5']); echo Html::jsFile('@web/js/main.js'); echo Html::a('超链接', ['home/list', 'id' => 12], ['class' => 'link']); echo Html::mailto('Contact Us', '*****@*****.**'); echo Html::img('@web/images/logo.png', ['alt' => 'logo']); ?> <hr/> <?php echo Html::beginForm(['home/add', 'id' => $id], 'post', ['enctype' => 'multipart/form-data']); echo Html::input('text', 'username', 'name', ['class' => 'name']); echo Html::radio('agree', true, ['label' => 'this is radio']); echo Html::checkbox('agree', true, ['label' => 'this is checkbox']); ?> <?php echo Html::dropDownList('list', 1, ArrayHelper::map($option, 'id', 'name')); echo Html::listBox('listBox', 2, ArrayHelper::map($option, 'id', 'name')); ?>
public function actionPassreset() { $model = new passResetForm(); if ($model->load(Yii::$app->request->post()) && $model->validate()) { if ($model->passReset()) { Yii::$app->session->setFlash('success', 'Ваш запрос обработан. Проверьте электронную почту для получения дальнейших инструкций'); return $this->goHome(); } else { Yii::$app->session->setFlash('error', 'При сбросе пароля произошла ошибка. Обратитесь к ' . Html::mailto('администратору', Yii::$app->params['adminEmail']) . ' за поддержкой'); } } return $this->render('passreset', ['model' => $model]); }
public static function getCreator() { return Html::mailto('Abhimanyu Saharan', '*****@*****.**'); }
use yii\helpers\Html; $this->title = Yii::t('app', $name); $this->params['breadcrumbs'][] = $this->title; $this->params['title_icon'] = Yii::$app->params['general']['error_icon']; ?> <div class="site-error"> <div class="panel panel-default"> <div class="panel-body posts"> <div class="alert alert-danger"> <?php echo nl2br(Html::encode($message)); ?> </div> <p> <?php echo Yii::t('app', 'The above error occurred while the Web server was processing your request.'); ?> </p> <p> <?php echo Yii::t('app', 'Please contact us if you think this is a server error. Thank you.'); ?> (<?php echo Html::mailto(Yii::$app->params['general']['email_icon'] . ' ' . Yii::$app->params['app']['email']); ?> ) </p> </div> </div> </div>
<div class="row"> <div class="col-xs-4"> <h1 class="foot__title"> ИП Колтунов </h1> <p class="foot__description"> Мягкая мебель на заказ в Волгограде. <br /> Вся информация на сайте носит справочный характер и не является публичной офертой. </p> <div><span class="icon-phone icon-inline"></span> <?php echo $app->params['contactPhone']; ?> </div> <div> <span class="icon-email icon-inline"></span> <?php echo Html::mailto($app->params['contactEmail'], $app->params['contactEmail'], ['class' => 'outer-link']); ?> </div> </div> <div class="col-xs-8"> <?php if (isset($this->blocks['footerBlock'])) { ?> <?php echo $this->blocks['footerBlock']; ?> <?php } ?> </div> </div>
<?php echo $content; ?> </div> </div> <footer class="footer"> <div class="container"> <p class="pull-left">© <?php echo Yii::$app->config->get(Enum::APP_NAME); ?> <?php echo date('Y'); ?> </p> <p class="pull-right">Maintained By <?php echo Html::mailto('Admin', Yii::$app->config->get(Enum::ADMIN_EMAIL)); ?> </p> </div> </footer> <?php $this->endBody(); ?> </body> </html> <?php $this->endPage();
/** * Generate the Mail Tag. * * @param string $value The Brackets value `[]`. * @param string $sub The optional Parentheses value `()` * @see \luya\tag\TagInterface::parse() * @return string The parser tag. */ public function parse($value, $sub) { return Html::mailto(!empty($sub) ? $sub : $value, $value); }
<body> <?php $this->beginBody(); ?> <div class="container" style="margin: 0 auto;max-width: 700px;padding-top: 80px;"> <?php echo $content; ?> <div class="text"> <p class="pull-left"><?php echo InstallerModule::poweredBy(); ?> </p> <p class="pull-right">Created By <?php echo Html::mailto(InstallerModule::getAuthor(), InstallerModule::getAuthorEmail()); ?> </p> </div> </div> <?php $this->endBody(); ?> </body> </html> <?php $this->endPage();
public function testMailto() { $this->assertEquals('<a href="mailto:test<>">test<></a>', Html::mailto('test<>')); $this->assertEquals('<a href="mailto:test>">test<></a>', Html::mailto('test<>', 'test>')); }
<p> <small><?php echo Yii::t('app', 'Phone private'); ?> </small> <br/><?php echo Html::a(Phone::getFormatView($model->phone_private), 'tel:' . $model->phone_private); ?> </p> <p> <small><?php echo Yii::t('app', 'Email work'); ?> </small> <br/><?php echo Html::mailto($model->email_work, $model->email_work); ?> </p> <p> <small><?php echo Yii::t('app', 'Status'); ?> </small> <br/><span class="label label-success label-form">Работает</span> </p> </div> </div> </div> <!-- END CONTACT ITEM -->
/** * Formats the value as a mailto link. * @param string $value the value to be formatted. * @param array $options the tag options in terms of name-value pairs. See [[Html::mailto()]]. * @return string the formatted result. */ public function asEmail($value, $options = []) { if ($value === null) { return $this->nullDisplay; } return Html::mailto(Html::encode($value), $value, $options); }
use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $name string */ /* @var $message string */ /* @var $exception Exception */ $this->title = 'Ошибка!'; ?> <div class="site-error"> <div class="row"> <div class="col-xs-12 col-xs-offset-0 col-sm-offset-1 col-sm-10 site-login"> <h1><?php echo Html::encode($this->title); ?> </h1> <div class="alert alert-danger"> <?php echo nl2br(Html::encode($message)); ?> </div> <p> Упс... Ошибка. Пожалуйста, сообщите администрации сайта <?php echo Html::mailto(Yii::$app->params['adminEmail']); ?> </p> </div> </div> </div>
* @link https://github.com/brussens/yii2-maintenance-mode */ use yii\helpers\Html; ?> <h1>We’ll be back soon!</h1> <div> <p> <?php if (Yii::$app->maintenanceMode->message) { ?> <?php echo Yii::$app->maintenanceMode->message; ?> <?php } else { ?> Sorry for the inconvenience but we’re performing some maintenance at the moment. If you need to you can always <?php echo Html::mailto('contact us', \Yii::$app->params['adminEmail'] ? \Yii::$app->params['adminEmail'] : '#'); ?> , otherwise we’ll be back online shortly! <?php } ?> </p> </div>
public function run() { if ($this->encode) { $this->text = Html::encode($this->text); } if (!$this->minimal) { $maxOembedCount = 3; // Maximum OEmbeds $oembedCount = 0; // OEmbeds used $that = $this; $pattern = <<<REGEXP /(?(R) # in case of recursion match parentheses \t\t\t\t \\(((?>[^\\s()]+)|(?R))*\\) \t\t\t| # else match a link with title \t\t\t\t(https?|ftp):\\/\\/(([^\\s()]+)|(?R))+(?<![\\.,:;\\'"!\\?\\s]) \t\t\t)/x REGEXP; $this->text = preg_replace_callback($pattern, function ($match) use(&$oembedCount, &$maxOembedCount, &$that) { // Try use oembed if ($maxOembedCount > $oembedCount) { $oembed = UrlOembed::GetOembed($match[0]); if ($oembed) { $oembedCount++; return $oembed; } } return Html::a($match[0], Html::decode($match[0]), array('target' => '_blank')); }, $this->text); // mark emails $this->text = preg_replace_callback('/[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*(\\.[a-zA-Z]{2,3})/', function ($match) { return Html::mailto($match[0]); }, $this->text); } // get user and space details from guids $this->text = self::translateMentioning($this->text, $this->minimal ? false : true); // create image tag for emojis $this->text = self::translateEmojis($this->text, $this->minimal ? false : true); if ($this->maxLength != 0) { $this->text = \humhub\libs\Helpers::truncateText($this->text, $this->maxLength); } $this->text = trim($this->text); if (!$this->minimal) { $output = nl2br($this->text); } else { $output = $this->text; } // replace leading spaces with no break spaces to keep the text format $output = preg_replace_callback('/^( +)/m', function ($m) { return str_repeat(" ", strlen($m[1])); }, $output); $this->trigger(self::EVENT_BEFORE_OUTPUT, new ParameterEvent(['output' => &$output])); return trim($output); }