public function actionMapalugares($categoria_id)
 {
     //        $model = new Place();
     //        $model = $this->findModel($punto_id);
     $categoria = \app\models\CategoryGoogle::findOne($categoria_id);
     $dataProvider = new ActiveDataProvider(['query' => Place::find()]);
     return $this->render('mapaLugares', ['categoria' => $categoria, 'dataProvider' => $dataProvider]);
 }
Exemple #2
0
 public function getCategoryGoogleStr()
 {
     $strCat = "";
     $placeCategory = PlaceCategory::findAll(['place_id' => $this->place_id]);
     foreach ($placeCategory as $mcat) {
         $strCat = $strCat . " | " . CategoryGoogle::findOne($mcat->categoria_id)->name;
     }
     return $strCat;
 }
 /**
  * Finds the CategoryGoogle model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return CategoryGoogle the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = CategoryGoogle::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }