Exemple #1
0
 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]);
 }
Exemple #2
0
 /**
  * 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]);
 }