public function actionHot() { $dataProvider = Post::getHotPosts(); $tags = array(); for ($i = 0; $i < count($dataProvider->getModels()); $i++) { array_push($tags, Post_tags::getTags($dataProvider->getModels()[$i]['post_id'])); } return $this->render('hot', ['dataProvider' => $dataProvider, 'tags' => $tags, 'sort' => ['attributes' => ['asc' => ['id' => SORT_ASC]]]]); }
public function actionIndex() { $dataProvider = Post::getHotPosts(); return $this->render('index', ['dataProvider' => $dataProvider]); return $this->render('index'); }