コード例 #1
0
 /**
  * Creates a new TravellersVerification model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new TravellersVerification();
     $traveller_id = isset($_GET['traveller_id']) ? $_GET['traveller_id'] : 0;
     if ($model->load(Yii::$app->request->post())) {
         if (isset($model->email_code) && $model->email_code != '') {
             echo 'good';
             $model->email_status = 1;
         }
         if ($model->save()) {
             return $this->redirect(['update', 'id' => $model->id]);
         }
     } else {
         return $this->render('create', ['model' => $model, 'traveller_id' => $traveller_id]);
     }
 }