public function actionSearch($location_id) { $model = new GooglePlace(['location_id' => $location_id]); if ($model->load(Yii::$app->request->post())) { $url = $model->urlBuilder('json'); $curl = new \linslin\yii2\curl\Curl(); $response = \yii\helpers\ArrayHelper::toArray(json_decode($curl->get($url))); if ($response['status'] == "OK") { $arrayDataProvider = new \yii\data\ArrayDataProvider(['allModels' => $response['results'], 'pagination' => ['pageSize' => 200]]); return $this->render('index', ['dataProvider' => $arrayDataProvider]); } } else { return $this->render('search', ['model' => $model]); } }