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]);
 }
Exemple #2
0
 /**
  * Renders the index view for the module
  * @return string
  */
 public function actionIndex()
 {
     $model = Post::find()->all();
     return $this->render('index', ['model' => $model]);
 }
Exemple #3
0
 /**
  * Lists all Post models.
  * @return mixed
  */
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => Post::find()->where(['type' => 'forum'])]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }