Exemplo n.º 1
0
 public function actionLoadPeta($idWil)
 {
     //\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
     $model = GeoserverUrl::findOne(['id_wilayah' => $idWil]);
     $peta = file_get_contents($model->url);
     return $peta;
 }
Exemplo n.º 2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = GeoserverUrl::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'zoom' => $this->zoom, 'center_x' => $this->center_x, 'center_y' => $this->center_y, 'tipe' => $this->tipe]);
     $query->andFilterWhere(['like', 'id_wilayah', $this->id_wilayah])->andFilterWhere(['like', 'url', $this->url]);
     return $dataProvider;
 }
Exemplo n.º 3
0
 /**
  * Finds the GeoserverUrl model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return GeoserverUrl the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = GeoserverUrl::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Exemplo n.º 4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getGeoserverUrls()
 {
     return $this->hasMany(GeoserverUrl::className(), ['id_wilayah' => 'id']);
 }