public function getParsedText($params = []) { $match = null; $text = $this->text; if (preg_match_all('/{{page:([\\w-]+)}}/i', $text, $match)) { foreach ($match[0] as $key => $value) { $page = Page::get($match[1][$key]); if ($page) { $content = $page->parsedText; } else { $content = ''; } $text = str_ireplace($value, $content, $text); } } if (preg_match_all('/{{setting:([\\w-]+)}}/i', $text, $match)) { foreach ($match[0] as $key => $value) { $content = Setting::get($match[1][$key]); $text = str_ireplace($value, $content, $text); } } if (preg_match_all('/{{var:([\\w-]+)}}/i', $text, $match)) { foreach ($match[0] as $key => $value) { if (isset($params[$match[1][$key]])) { $text = str_ireplace($value, $params[$match[1][$key]], $text); } } } return $text; }
public static function send($toEmail, $subject, $template, $data = [], $options = []) { if (!filter_var($toEmail, FILTER_VALIDATE_EMAIL) || !$subject || !$template) { /** @TODO */ // return false; } $data['subject'] = trim($subject); $message = null; if (strncmp($template, 'p@', 2) === 0) { $page = Page::get(substr($template, 2)); if ($page) { $message = Yii::createObject(['class' => Yii::$app->mailer->messageClass, 'mailer' => Yii::$app->mailer]); $message->setHtmlBody($page->getParsedText($data)); } } else { try { $message = Yii::$app->mailer->compose($template, $data); } catch (\Exception $ex) { ob_clean(); } } if (!$message) { return false; } $message->setTo(explode(',', str_ireplace(' ', '', $toEmail))); $message->setSubject($data['subject']); if (filter_var(Setting::get('robot_email'), FILTER_VALIDATE_EMAIL)) { $message->setFrom(Setting::get('robot_email')); } if (!empty($options['replyTo']) && filter_var($options['replyTo'], FILTER_VALIDATE_EMAIL)) { $message->setReplyTo($options['replyTo']); } $result = $message->send(); if (!$result) { } return $result; }
<?php use yii\easyii\modules\guestbook\api\Guestbook; use yii\easyii\modules\page\api\Page; $page = Page::get('page-guestbook'); $this->title = $page->seo('title', $page->model->title); $this->params['breadcrumbs'][] = $page->model->title; ?> <h1><?php echo $page->seo('h1', $page->title); ?> </h1> <div class="row"> <div class="col-md-8"> <br> <?php foreach (Guestbook::items(['pagination' => ['pageSize' => 2]]) as $item) { ?> <div class="guestbook-item"> <b><?php echo $item->name; ?> </b> <small class="text-muted"><?php echo $item->date; ?> </small> <p><?php echo $item->text; ?>
public function actionPage($slug) { $page = Page::get($slug); return $this->render('page', ['page' => $page]); }
<p><?php echo $data->text; ?> </p> </div> <!-- END TEAM --> </div> <?php } ?> </div> </div> <?php $waistPage = Page::get('waist-guid'); ?> <div class="container-fluid"> <div class="container"> <div class="title"><?php echo $waistPage->title; ?> </div> <div class="col-md-offset-1 col-md-10 expir text-center"> <?php echo $waistPage->text; ?> </div> ` <div class="col-7 fadeIn wow">
<?php use yii\easyii\modules\article\api\Article; use yii\easyii\modules\carousel\api\Carousel; use yii\easyii\modules\gallery\api\Gallery; use yii\easyii\modules\guestbook\api\Guestbook; use yii\easyii\modules\news\api\News; use yii\easyii\modules\page\api\Page; use yii\easyii\modules\text\api\Text; use yii\helpers\Html; use yii\easyii\models\Setting; $page = Page::get('about'); $this->title = $page->seo('title', $page->model->title); ?> <div class="content"> <div class="container"> <div class="row"> <div class="col-md-12"> <h2 class="title">site map</h2> </div> </div> <div class="row"> <div class="site-map center-block"> <a href="#"><i class="fa fa-circle"></i> home</a> <a href="#"><i class="fa fa-circle"></i> About Dry</a> <a href="#"><span><i class="fa fa-circle-o"></i> whos dry</span></a> <a href="#"><span><i class="fa fa-circle-o"></i> awareness program</span></a> <a href="#"><i class="fa fa-circle"></i> Products</a> <a href="#"><i class="fa fa-circle"></i> Offers</a> <a href="#"><i class="fa fa-circle"></i> Find a store</a>
<?php use yii\easyii\modules\catalog\api\Catalog; use yii\easyii\modules\file\api\File; use yii\easyii\modules\page\api\Page; use yii\helpers\Html; $page = Page::get('page-shop'); $this->title = $page->seo('title', $page->model->title); $this->params['breadcrumbs'][] = $page->model->title; $this->params['metatitle'] = '��� ���� ���������,���� ��� ���� ������ �������,��� ���� ������� '; $this->params['meta_keyword'] = yii::t('easyii', 'Better sanitary napkin after birth, sanitary napkin for married , the best types of sanitary pads, better health towel menstrual cycle'); $this->params['meta_description'] = yii::t('easyii', 'Dry better sanitary napkin for married and sensitive skin care sensitive region before marriage is also the best types of sanitary pads for nifaas'); function renderNode($node) { if (!count($node->children)) { $html = '<li>' . Html::a($node->title, ['/shop/cat', 'slug' => $node->slug]) . '</li>'; } else { $html = '<li>' . $node->title . '</li>'; $html .= '<ul>'; foreach ($node->children as $child) { $html .= renderNode($child); } $html .= '</ul>'; } return $html; } ?> <div class="row"> <div class="col-md-8">
<?php use yii\easyii\modules\page\api\Page; use yii\easyii\modules\shopcart\api\Shopcart; use yii\helpers\Html; use yii\easyii\modules\shopcart\models\Order; $page = Page::get('page-shopcart-success'); $successCode = Page::get('successcode'); echo $successCode->text; $pay = Page::get('paydetails'); $this->title = 'Thank you '; $this->params['breadcrumbs'][] = $page->model->title; ?> <div class="content"> <div class="container"> <!--<?php echo Yii::t('easyii', 'order online'); ?> --> <h2 class="title"><?php echo $page->title; ?> </h2> <div class="sub-title col-md-12"> <p style="text-align: center;"><?php echo $page->text; ?> </p> </div>
<?php use yii\easyii\modules\faq\api\Faq; use yii\easyii\modules\page\api\Page; $page = Page::get('page-faq'); $this->title = $page->seo('title', $page->model->title); $this->params['breadcrumbs'][] = $page->model->title; ?> <h1><?php echo $page->seo('h1', $page->title); ?> </h1> <br/> <?php foreach (Faq::items() as $item) { ?> <p><b>Question: </b><?php echo $item->question; ?> </p> <blockquote><b>Answer: </b><?php echo $item->answer; ?> </blockquote> <?php }
echo Html::a($pageAbout->title, ['/contact-us'], ['class' => '']); ?> <br/> <?php echo $pageAbout->text; ?> .</p> <?php } ?> <?php $pageAbout = Page::get('find-store'); if (strpos($pageAbout->title, $text) !== false or strpos($pageAbout->text, $text) !== false) { $i = 1; ?> <p class="search-result"> <?php echo Html::a($pageAbout->title, ['/stores'], ['class' => '']); ?> <br/> <?php echo $pageAbout->text; ?> .</p> <?php } ?>
</div> <div class="container"> <div class="row margin-top30"> <div class="col-sm-4"> <div class="embed-responsive embed-responsive-4by3"> <?php $page = Page::get('productpage'); ?> <?php echo $page->text; ?> </div> </div> <div class="col-sm-8"> <?php $page = Page::get('rightchoice'); ?> <div class="title"> <?php echo $page->title; ?> </div> <p><?php echo $page->text; ?> </p> </div> </div> </div> <div class="container-fluid review-bg">
<?php use yii\easyii\modules\page\api\Page; use yii\helpers\Html; $page = Page::get('page-about'); $page_opening_hours = Page::get('page-about-opening-hours'); $this->title = $page->seo('title', $page->model->title); $this->params['breadcrumbs'][] = $page->model->title; ?> <h1><?php echo $page->title; ?> </h1> <div class="clearfix pad_top13"> <div class="col-md-12"> <div class="row"> <?php echo $page->text; ?> </div> </div> <!-- <div class="col-md-6"> <div class="right_content "> <?php echo $page_opening_hours->text; ?> </div> </div> -->
</div> </div> </span> <div class="clearfix"></div> <div class="col-md-12"> <div class="online-method"> <div class="left"> <?php $page = Page::get('find-store'); ?> <?php echo $page->text; ?> <a href="/products-online" class="btn dry-btn"><?php echo Yii::t('easyii', 'Online Method'); ?> </a> </div> </div> </div> </div> </div> </div>
<?php use yii\helpers\Html; use yii\helpers\Url; use yii\widgets\ActiveForm; use yii\easyii\modules\page\api\Page; // //$this->title = $cat->seo('title', $cat->model->title); $this->title = yii::t('easyii', 'Dry Offers'); $this->params['meta_keyword'] = yii::t('easyii', 'Sanitary napkin for the married, the Dry trunk of birth, better sanitary napkin for sensitive skin, better sanitary napkin after birth, types of towels PMS'); $this->params['meta_description'] = yii::t('easyii', 'DRY Arabia offers best sanitary pads to take care of the sensitive region before marriage and offers the best kinds of towels menstrual cycle '); $this->params['breadcrumbs'][] = ['label' => 'Shop', 'url' => ['shop/index']]; $this->params['breadcrumbs'][] = $cat->model->title; //var_dump($this->params['sliderFilters']); //echo $sliderFilters['absorptionrate'].'dd';die; $page = Page::get('offerpage'); ?> <style> .navbar-fixed-top{ position:absolute !important; } </style> <div class="content"> <div class="container"> <div class="row"> <div class="col-md-12"> <h2 class="title"><?php echo $page->title; ?> </h2>
<?php use yii\easyii\modules\catalog\api\Catalog; use yii\easyii\modules\page\api\Page; $page = Page::get('page-shop-search'); $this->title = 'Search'; $this->params['breadcrumbs'][] = ['label' => 'Shop', 'url' => ['shop/index']]; $this->params['breadcrumbs'][] = $page->model->title; ?> <h1><?php echo $page->seo('h1', $page->title); ?> </h1> <br/> <?php echo $this->render('_search_form', ['text' => $text]); ?> <br/> <div class="row"> <div class="col-md-8"> <?php if (count($items)) { ?> <?php foreach ($items as $item) { ?> <?php echo $this->render('_item', ['item' => $item]); ?> <?php }
<?php use yii\easyii\modules\news\api\News; use yii\easyii\modules\page\api\Page; use yii\helpers\Html; use yii\helpers\Url; $page = Page::get('page-news'); $this->title = $page->seo('title', $page->model->title); $this->params['breadcrumbs'][] = $page->model->title; ?> <h1><?php echo $currentNews->title; ?> </h1> <div class="clearfix pad_top13"> <div class="col-md-7"> <div class="row"> <?php echo Html::img($currentNews->thumb(480, 240)); ?> <?php echo $currentNews->text; ?> <?php if (count($currentNews->photos)) { ?> <div> <h4>Фото</h4>
<?php use yii\helpers\Url; use yii\easyii\modules\page\api\Page; use yii\easyii\modules\text\api\Text; use yii\easyii\modules\carousel\api\Carousel; $page = Page::get($page); if (!is_null($page)) { $this->title = $page->title; } ?> <header id="myCarousel" class="carousel slide"> <?php echo Carousel::widget('3000', '520', []); ?> </header> <div class="container"> <div class="row"> <div class="col-md-12"> <h1><?php echo $page->title; ?> </h1> <p><?php
public function actionIndex() { $page = Page::get('page-faq'); return $this->render('index', ['page' => $page]); }
<?php use yii\easyii\modules\article\api\Article; use yii\easyii\modules\carousel\api\Carousel; use yii\easyii\modules\gallery\api\Gallery; use yii\easyii\modules\guestbook\api\Guestbook; use yii\easyii\modules\news\api\News; use yii\easyii\modules\page\api\Page; use yii\easyii\modules\text\api\Text; use yii\helpers\Html; use yii\helpers\Url; use yii\widgets\Menu; use app\widgets\tiledslider\TiledSlider; $page = Page::get('page-index'); $this->title = $page->seo('title', $page->model->title); ?> <!--Home Page =============================--> <div id="home" class="item"> <div class="clearfix"> <div class="header_details"> <div class="container"> <div class="header_icons accura-header-block accura-hidden-2xs"> <ul class="accura-social-icons accura-stacked accura-jump accura-full-height accura-bordered accura-small accura-colored-bg clearFix"> <li id="1"><a href="https://www.facebook.com/caffeshopmh" target="_blank" class="accura-social-icon-facebook circle"><i class="fa fa-facebook"></i></a></li> <li id="2"><a href="https://twitter.com/caffeshop_media" target="_blank" class="accura-social-icon-twitter circle"><i class="fa fa-twitter"></i></a></li> <!--<li id="3"><a href="#" target="_blank" class="accura-social-icon-gplus circle"><i class="fa fa-google-plus"></i></a></li>--> <li id="4"><a href="https://www.pinterest.com/kuldyshev/caffeshop-specialty-coffee-%D0%B4%D0%B5%D0%BA%D0%BE%D0%BA%D1%82-%D0%B1%D0%B0%D1%80/" target="_blank" class="accura-social-icon-pinterest circle"><i class="fa fa-pinterest"></i></a></li> <!--<li id="5"><a href="https://www.linkedin.com/profile/view?id=AAIAABHaqUwByQwUBOAeGBG7pAoda8UyDDQ-15w&trk=nav_responsive_tab_profile_pic" target="_blank" class="accura-social-icon-linkedin circle"><i class="fa fa-linkedin"></i></a></li>-->
<?php use yii\easyii\modules\article\api\Article; use yii\easyii\modules\page\api\Page; use yii\helpers\Html; $page = Page::get('page-articles'); $this->title = $page->seo('title', $page->model->title); $this->params['breadcrumbs'][] = $page->model->title; function renderNode($node) { if (!count($node->children)) { $html = '<li>' . Html::a($node->title, ['/articles/cat', 'slug' => $node->slug]) . '</li>'; } else { $html = '<li>' . $node->title . '</li>'; $html .= '<ul>'; foreach ($node->children as $child) { $html .= renderNode($child); } $html .= '</ul>'; } return $html; } ?> <h1><?php echo $page->title; ?> </h1> <div class="clearfix pad_top13"> <div class="col-md-8"> <p class="row">
<?php use yii\easyii\modules\page\api\Page; use yii\easyii\modules\shopcart\api\Shopcart; use yii\helpers\Html; use yii\helpers\Url; use yii\easyii\models\Setting; $page = Page::get('page-shopcart'); $this->title = yii::t('easyii', 'Checkout'); $this->params['breadcrumbs'][] = $page->model->title; $delivery = Setting::get('deliver_cost'); ?> <?php $page = Page::get('shopcartpage'); ?> <div class="content"> <div class="container"> <h2 class="title"><?php echo $page->title; ?> </h2> <div class="sub-title"><?php echo $page->text; ?> </div> </div>
foreach (Gallery::last(1, ['item_id' => Gallery::cat('awarness-gallery')->model->category_id]) as $photo) { ?> <img class="img-responsive" src="<?php echo $photo->image; ?> "> <?php } ?> <div class="container"> <div class="row"> <div class="col-md-12"> <?php $page = Page::get('know-more-about-us'); ?> <h2 class=" lined-heading"><span><?php echo $page->title; ?> </span></h2> </div> <div class="lineHeight awarness"> <?php echo $page->text; ?> </div> </div> </div> <div class="request-programe">
</p> </div> </div> </div> </div> <div class="container-fluid bg margin-top50 contactpage"> <div class="container"> <div class="row contact-us"> <div class="col-sm-5 col-sm-offset-1"> <?php $page = Page::get("contact-address"); echo $page->text; ?> </div> <div class="col-sm-4 col-sm-offset-1 order-online"> <?php if ($Saved) { ?> <div class="well"><h4 class="text-success"><i class="glyphicon glyphicon-ok"></i> <?php echo Yii::t('easyii', 'Message successfully sent'); ?> </h4></div> <?php
<?php use yii\easyii\modules\page\api\Page; use yii\easyii\modules\shopcart\api\Shopcart; use yii\helpers\Html; use yii\helpers\Url; use yii\easyii\models\Setting; $page = Page::get('page-shopcart'); $this->title = $page->seo('title', $page->model->title); $this->params['breadcrumbs'][] = $page->model->title; $delivery = Setting::get('deliver_cost'); ?> <div class="content"> <div class="container"> <h2 class="title"><?php echo Yii::t('easyii', 'order online'); ?> </h2> <div class="sub-title"><?php echo Yii::t('easyii', 'Choose from any of the special offers below to enjoy valuable savings on Poise® protection.'); ?> </div> <div class="row"> <?php if (count($goods)) {
<?php use yii\easyii\modules\feedback\api\Feedback; use yii\easyii\modules\page\api\Page; $page = Page::get('page-contact'); $this->title = $page->seo('title', $page->model->title); $this->params['breadcrumbs'][] = $page->model->title; ?> <h1><?php echo $page->seo('h1', $page->title); ?> </h1> <div class="row"> <div class="col-md-8"> <?php echo $page->text; ?> </div> <div class="col-md-4"> <?php if (Yii::$app->request->get(Feedback::SENT_VAR)) { ?> <h4 class="text-success"><i class="glyphicon glyphicon-ok"></i> Message successfully sent</h4> <?php } else { ?> <div class="well well-sm"> <?php echo Feedback::form();
<?php use yii\easyii\helpers\Image; use yii\easyii\modules\gallery\api\Gallery; use yii\easyii\modules\page\api\Page; use yii\helpers\Html; use yii\helpers\Url; $page = Page::get('page-gallery'); $this->title = $page->seo('title', $page->model->title); $this->params['breadcrumbs'][] = $page->model->title; ?> <h1><?php echo $page->seo('h1', $page->title); ?> </h1> <br/> <?php foreach (Gallery::cats() as $album) { ?> <a class="center-block" href="<?php echo Url::to(['gallery/view', 'slug' => $album->slug]); ?> "> <?php echo Html::img(Image::thumb($album->image, 160, 120)); ?> <br/><?php echo $album->title; ?> </a>
<?php use yii\easyii\modules\page\api\Page; use yii\easyii\modules\shopcart\api\Shopcart; use yii\helpers\Html; $page = Page::get('page-shopcart-success'); $this->title = $page->seo('title', $page->model->title); $this->params['breadcrumbs'][] = $page->model->title; ?> <h1><?php echo $page->seo('h1', $page->title); ?> </h1> <br/> <?php echo $page->text;
public function actionWhite_label() { $page = Page::get('page-white-label'); $cat = Article::cat('white-label'); if (!$cat) { throw new \yii\web\NotFoundHttpException('Page not found.'); } return $this->render('white_label', ['page' => $page, 'cat' => $cat, 'label_items' => $cat->items()]); }