public function indexAction() { $prodId = (int) $this->getRequestParam('id', 0); $prodTbl = new Product(); $product = $prodTbl->getProduct($prodId); $componentMenu = new TopMenuComponent($this); $componentMenuResp = $componentMenu->toString(); if (!$product) { $this->notFound(); } $this->render(array('product' => $product, 'leftMenu' => $componentMenuResp), 'App/Product/product.html'); }
public function categoryAction() { $catId = (int) $this->getRequestParam('id', 0); $catTbl = new Category(); $category = $catTbl->getCategory($catId); if (!$category) { $this->notFound(); } $categories = $catTbl->getAllThisLevelCategories($catId); $products = $catTbl->getProductsFromCategory($catId); $componentMenu = new TopMenuComponent($this); $componentMenuResp = $componentMenu->toString(); $this->render(array('category' => $category, 'categories' => $categories, 'products' => $products, 'leftMenu' => $componentMenuResp), 'App/Category/products.html'); }