예제 #1
0
 function indexAction()
 {
     $fc = FrontController::getInstance();
     $model = new FrontModel();
     $popProducts = (new IndexWidgets())->recAndPopProductsWidget('popular', 6);
     $recProducts = (new IndexWidgets())->recAndPopProductsWidget('recommended');
     $model->setData(['slides' => IndexWidgets::getSliderWidget(), 'currentCategory' => (new IndexWidgets())->currentCategoryWidget(Helper::getSiteConfig()->currentCategoryWidget), 'popularProducts' => Generator::popularProducts($popProducts, 6), 'recommendedProducts' => Generator::recommendedProducts($recProducts)]);
     $output = $model->render('../views/index.php', 'main');
     $fc->setPage($output);
 }
예제 #2
0
 public static function emailHandler($to = FALSE)
 {
     try {
         if (!$to) {
             $to = Helper::getSiteConfig()->contactinfo->siteMail->value;
         }
         if (empty(self::$data)) {
             throw new Exception('Класс не инициализирован должным образом');
         }
         self::emailSender((string) $to, self::$data['subject'], self::$data['message'], self::$data['email']);
         return TRUE;
     } catch (Exception $ex) {
         Session::setUserMsg('Пожалуйста, заполните все поля формы', 'danger');
         header('Location: ' . $_SERVER['REQUEST_URI']);
     }
 }
예제 #3
0
 private function cleanImgSrc($data)
 {
     return str_replace(Helper::getSiteConfig()->general->siteHost, '', $data);
 }
예제 #4
0
 private function sendValidateCode()
 {
     $siteName = Helper::getSiteConfig()->general->siteName;
     $siteHost = Helper::getSiteConfig()->general->siteHost;
     $subject = 'Подтверждение регистрации на сайте ' . $siteName;
     $content = '
                      <p>Здравствуйте! Благодарим вас за регистрацию на сайте ' . $siteName . '</p>
                      <p>Для подтверждения регистрации пройдите по ссылке:</p>
                      <a href="' . $siteHost . '/user/validate/email/' . $this->email . '/key/' . $this->validateKey . '">Подтвердить email</a>';
     Mailer::emailSender($this->email, $subject, $content);
 }