public function actionIndex() { $searchModel = new CatalogSearch(); $dataProvider = $searchModel->search($this->modelName, Yii::$app->request->queryParams); return $this->render('/catalog/index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'modelTitle' => $this->modelTitle]); /* $dataProvider = new ActiveDataProvider([ 'query' => call_user_func([$this->modelName , 'find']), ]); return $this->render('/catalog/index', [ 'dataProvider' => $dataProvider, 'modelTitle' => $this->modelTitle ]); */ }
/** * Lists all Catalog models. * @return mixed */ public function actionIndex() { $searchModel = new CatalogSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }