/** * Updates an existing EmailRecord model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed */ public function actionUpdate($id) { $listCustomer = CustomerRecord::getListCustomer(); $model = $this->findModel($id); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->email_id]); } else { return $this->render('update', ['model' => $model, 'listCustomer' => $listCustomer]); } }