/** * Просмотр списка постов по тегу * @param $id * @return string */ public function actionView($id) { $tagModel = new Tags(); $tag = $tagModel->getTag($id); $categoryModel = new Category(); return $this->render('view', ['tag' => $tag, 'posts' => $tag->getTagPosts(), 'categories' => $categoryModel->getCategories()]); }
/** * list of post group by tag * @param $id */ public function actionTagsort($id) { $tagModel = new Tags(); $tag = $tagModel->getTag($id); return $this->render('tagsort', ['tag' => $tag, 'posts' => $tag->getTagPosts()]); }