public function actionIndex() { $get = Yii::$app->request->get(); $res = Yii::$app->client->get('/city', $get); $filterModel = new CitySearch(); $filterModel->load($get, ''); $dataProvider = new RestDataProvider(['data' => $res, 'key' => 'id', 'sort' => ['attributes' => ['id', 'name', 'create_time', 'update_time']]]); return $this->render('index', ['dataProvider' => $dataProvider, 'filterModel' => $filterModel]); }
/** * Lists all City models. * @return mixed */ public function actionIndex() { $searchModel = new CitySearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }