public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => Post::find()->orderBy('id DESC'), 'pagination' => ['pageSize' => 10]]); $this->view->title = 'Forum'; return $this->render('index', ['dataProvider' => $dataProvider]); }
/** * Renders the index view for the module * @return string */ public function actionIndex() { $model = Post::find()->all(); return $this->render('index', ['model' => $model]); }
/** * Lists all Post models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => Post::find()->where(['type' => 'forum'])]); return $this->render('index', ['dataProvider' => $dataProvider]); }