public function actionIndex() { $educationsTop = new EducationalInstitutionTop(); $searchModel = new EducationalInstitutionSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'educationsTop' => $educationsTop->getTop()]); }
public function getTop() { $query = EducationalInstitutionTop::find(); return $dataProvider = new ActiveDataProvider(['query' => $query]); }