public function actionUpdate($id)
{
$model = $this->findModel($id);

if ($model->load($_POST) && $model->save()) {
return $this->redirect(Url::previous());
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
public function actionUpdate($id)
{
$model = $this->findModel($id);

if ($model->load($_POST) && $model->save()) {
return $this->redirect(Url::previous());
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
public function actionUpdate ( $ id ) { $ model = $ this -> findModel ( $ id ) ; if ( $ model -> load ( $ _POST ) && $ model -> save ( ) ) { return $ this -> redirect ( Url :: previous ( ) ) ; } else { return $ this -> render ( 'update' , [ 'model' => $ model , ] ) ; } }
Updates an existing Country model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed
Updates an existing Country model . If update is successful the browser will be redirected to the view page .