public function run() { if (false !== empty($this->avatar) && strtolower(pathinfo($this->avatar, PATHINFO_EXTENSION)) != 'jpg') { //'avatar filetype must be jpg' $this->avatar = null; } else { $this->avatar = Yii::getAlias($this->avatar); if (!file_exists($this->avatar)) { $this->avatar = null; } } $formatter = new FormatCard(['name' => $this->name, 'phone' => $this->phone, 'avatar' => $this->avatar]); $this->text = $formatter->format(); return parent::run(); }
* Email:awebc@qq.com */ use yii\bootstrap\Html; use yii\helpers\Url; use xj\qrcode\QRcode; use xj\qrcode\widgets\Text; $shareBaseUrl = 'http://v.t.sina.com.cn/share/share.php'; $shareParams = ['appkey' => 'weibo', 'url' => $url, 'title' => 'tt', 'pic' => '/images/thumb.png']; $params = http_build_query($shareParams); $shareUrl = $shareBaseUrl . $params; ?> <ul> <li class="mb10"> <?php echo Text::widget(['outputDir' => '@webroot/uploads/qrcode', 'outputDirWeb' => '@web/uploads/qrcode', 'ecLevel' => QRcode::QR_ECLEVEL_L, 'text' => $shareUrl, 'size' => 3]); ?> </li> <li> <?php echo Html::icon('share'); ?> <a href='javascript:void((function(s,d){var f="<?php echo $shareUrl; ?> ";function a(){if(!window.open(f,"mb",["toolbar=0,status=0,resizable=1,width=440,height=430,left=",(s.width-440)/2,",top=",(s.height-430)/2].join("")))location.href=f};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else a()})(screen, document))'>分享到微博</a> </li> </ul>
public function run() { $formatter = new FormatTel(['phone' => $this->phone]); $this->text = $formatter->format(); return parent::run(); }
public function run() { $formatter = new FormatEmail(['email' => $this->email, 'subject' => $this->subject, 'body' => $this->body]); $this->text = $formatter->format(); return parent::run(); }
<td class="cell4"><div class="text"><label name="time" class="textcell4"><?php echo $time; ?> час.</label>время</div></td> <td class="cell5"><div class="text"><label name="data" class="textcell5"><?php echo $date; ?> </label>дата</div></td> </tr> </table> <table class="table2"> <tr"> <td rowspan="4" class="cell6"> <div class="qrcode" id="qrcode"> <?php echo Text::widget(['outputDir' => '@webroot/tikets/qrcode', 'outputDirWeb' => '@web/tikets/qrcode', 'ecLevel' => QRcode::QR_ECLEVEL_L, 'text' => $qr, 'size' => 4]); ?> </div> </td> <td class="cell7">А</td> <td class="cell8"><label name="to" class="textcell8">МОСКВА-СИТИ</label>станция отправления</td> <td class="cell9" rowspan="2"><label name="money" class="textcell9"><?php echo $price; ?> р.</label>цена</td> </tr> <tr> <td class="cell10">Б</td> <td class="cell11"><label name="do" class="textcell11">ст. МАСТЕРСЛАВЛЬ</label>пункт назначения</td> </tr> <tr>