Esempio n. 1
0
 public function __call($n, $v)
 {
     $param = str_replace('action', '', $n);
     $param = str_replace('.html', '', $param);
     $article = new ArticleModel();
     $article->sql_params = array('name' => 'alias', 'value' => $param);
     $item = $article->findAllParams()[1];
     if (empty($item)) {
         die('Данный материал не доступен!');
     } else {
         // Получаем данные для корзины
         $basket_ob = new BasketModel();
         $basket = $basket_ob->getBasket();
         $labelprod = new ProductLabelModel();
         $slabel_items = $labelprod->getLabelProducts(2, 6);
         // Создаем шаблон и передаем ему нужные переменные
         $left_content = $this->template('/main/tpl_left.php', array('categories' => $this->catmenu->showMenu()));
         $sales_module = $this->template('/main/tpl_new_sales.php', array('stitle' => 'Акции', 'sitems' => $slabel_items));
         $right_content = $this->template('/main/tpl_article.php', array('article' => $item[0], 'sales_module' => $sales_module));
         $tmp = $this->template('/main/tpl_main.php', array('title' => 'Онлайн-аптека в Англии с доставкой', 'top_menu' => $this->top_menu, 'basket' => array('quantity' => $basket[0], 'price' => $basket[1]), 'left_content' => $left_content, 'right_content' => $right_content, 'fmenu' => $this->footer_menu));
         echo $tmp;
     }
 }