public function actionIndex()
 {
     $searchModel = new ContentSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider->query->andWhere(['content_type' => $this->content_type]);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Esempio n. 2
0
 /**
  * Lists all Content models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new ContentSearch();
     $dataProvider = $searchModel->search([]);
     $dataProvider->query->andWhere(['content_type' => $this->content_type]);
     $dataProvider->query->orderBy('created_at desc');
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }