public function render() { $header = new HeaderView(); $header->render(); echo " <div id='top' class='callbacks_container'>\n\n <!--- slider --->\n\n <link rel='stylesheet' href='/myshop/css/flickity.css' media='screen'>\n <script src='/myshop/js/flickity.js'></script>\n\n <div class='slider'>\n <div class='slider-cell'>\n <img src='images/slide1.png' alt=''>\n <div class='caption'>\n <div class='slide-text-info'>\n <h1>WILL HELM</h1>\n <label>SCHNAPS</label>\n <a class='slide-btn' href='#'><span>99.90\$</span> <small>GET NOW</small><label> </label></a>\n </div>\n </div>\n </div>\n <div class='slider-cell'>\n <img src='images/slide2.png' alt=''>\n <div class='caption'>\n <div class='slide-text-info'>\n <h1>FAST NER2</h1>\n <label>Dress Shoe</label>\n <a class='slide-btn' href='#'><span>99.90\$</span> <small>GET NOW</small><label> </label></a>\n </div>\n </div>\n </div>\n </div>\n\n\n\n <!--- end slider --->\n\n "; //render Products $products = new Products(); $productsview = new ProductView($products); $productsview->render(); echo "</div>"; echo "<script>\n \$('.slider').flickity({\n // options\n cellAlign: 'left',\n contain: true,\n wrapAround: true,\n autoPlay: 10000\n });\n </script>"; $footer = new FooterView(); $footer->render(); }
$comments = $this->comments->get_comments(array('type' => 'product', 'object_id' => $product->id, 'approved' => 1, 'ip' => $_SERVER['REMOTE_ADDR'])); // И передаем его в шаблон $this->design->assign('product', $product); $this->design->assign('comments', $comments); // Категория и бренд товара $product->categories = $this->categories->get_categories(array('product_id' => $product->id)); $this->design->assign('brand', $this->brands->get_brand(intval($product->brand_id))); $this->design->assign('category', reset($product->categories)); // Цвета товара if ($product_colors = $this->products->get_product_colors($id)) { $this->design->assign('product_colors', $product_colors); } // Размеры товара if ($product_sizes = $this->products->get_product_sizes($id)) { $sizes = []; foreach ($product_sizes as $product_size) { $sizes[$product_size->name] = $product_size; } ksort($sizes); $this->design->assign('product_sizes', $sizes); } $result = $this->design->fetch('new_product_modal.tpl'); header("Content-type: application/json; charset=UTF-8"); header("Cache-Control: must-revalidate"); header("Pragma: no-cache"); header("Expires: -1"); print json_encode($result); } } $page = new ProductView(); $page->fetch();