示例#1
0
 /**
  * Creates a new Places model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Places();
     $user_id = Yii::$app->user->identity->id;
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         Yii::$app->session->setFlash('success', 'Your information saved.');
         return $this->render('upload');
         echo Yii::$app->session->getFlash('success');
     } else {
         return $this->render('create', ['model' => $model, 'user_id' => $user_id]);
     }
 }