public function actionIndex() { /* $sources = Source::find()->orderBy('id DESC'); $dataProvider = new ActiveDataProvider([ 'query' => $sources, ]); return $this->render('index', ['sources' => $dataProvider]); */ $searchModel = new SourceSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['sources' => $dataProvider, 'searchModel' => $searchModel]); }
/** * Lists all Source models. * @return mixed */ public function actionIndex() { $searchModel = new SourceSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }