public function actionCategory() { $category_db = new CategoryDB(); $category_db->load($this->request->id); if (!$category_db->isSaved()) { $this->notFound(); } else { $this->section_id = $category_db->section_id; $this->title = $category_db->title; $this->meta_desc = $category_db->meta_desc; $this->meta_key = $category_db->meta_key; $section_db = new SectionDB(); $section_db->load($category_db->section_id); $hornav = $this->getHornav(); //горизонтальная навигация $hornav->addData($section_db->title, $section_db->link); $hornav->addData($category_db->title); $intro = new Intro(); $intro->hornav = $hornav; $intro->obj = $category_db; $category = new Category(); $articles = ArticleDB::getAllOnCatID($this->request->id, Config::COUNT_ARTICLES_ON_PAGE); $more_articles = ArticleDB::getAllOnSectionID($this->request->id, false, false); $category->articles = $articles; $this->render($intro . $category); } }
private function setSectionAndCategory() { $section = new SectionDB(); $section->load($this->section_id); $category = new CategoryDB(); $category->load($this->cat_id); if ($section->isSaved()) { $this->section = $section; } if ($category->isSaved()) { $this->category = $category; } }