コード例 #1
0
 /**
  * Updates an existing Coupon model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     $model = new CouponForm();
     $model->scenario = 'update';
     if ($model->load(Yii::$app->request->post()) && $model->updateCoupon($id)) {
         return $this->redirect(['index']);
     } else {
         return $this->render('update', ['model' => $model]);
     }
 }