コード例 #1
0
 public function actionIndex()
 {
     $model = Question::find()->with('answers')->where(['active' => 1]);
     $searchModel = new QuestionSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
コード例 #2
0
ファイル: QuestionController.php プロジェクト: hardshen/niuke
 /**
  * Lists all Question models.
  * @return mixed
  */
 public function actionIndex($id = '')
 {
     $searchModel = new QuestionSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $id);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }