コード例 #1
0
 public function actionIndex($type)
 {
     $searchModel = new ArticleSearch();
     $searchModel->type = $type;
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
コード例 #2
0
 public function actionIndex($type)
 {
     $searchModel = new ArticleSearch();
     $searchModel->type = $type;
     $contentDataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $contentDataProvider->query->andWhere(['isPublished' => true]);
     return $this->render('index', ['searchModel' => $searchModel, 'contentDataProvider' => $contentDataProvider]);
 }