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]); }
/** * 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]); }