Пример #1
0
 /**
  * Creates a new Venue model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Venue();
     $map = new \common\models\VenueMap();
     //$dataVenue=array();
     //$dataVenue=Yii::$app->request->post();
     //echo '<pre>';
     //if(count($dataVenue['Venue'])>0)
     // {
     // $data = Locality::find()->where(['Id'=>$dataVenue['Venue']['localityId']])->one();
     //$dataVenue['Venue']['zoneId']= $data['zoneId'];
     //}
     //var_dump($dataVenue);
     //die;
     if ($model->load(Yii::$app->request->post()) && $model->editsave()) {
         //if ($model->load($dataVenue) && $model->save())
         //{
         Yii::$app->session->setFlash("venue_notification", Yii::t("app", "Venue Created!"));
         return $this->redirect(['view', 'id' => $model->Id]);
         //echo "raj";
     } else {
         return $this->render('create', ['model' => $model, 'map' => $map]);
     }
 }