Advertisement
nazmiwafiy

actionUpdate

Dec 6th, 2018
710
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. /**
  2. * Updates an existing Contact model.
  3. * If update is successful, the browser will be redirected to the 'view' page.
  4. * @param integer $id
  5. * @return mixed
  6. */
  7. public function actionUpdate($id)
  8. {
  9. $model = $this->findModel($id);
  10.  
  11. if ($model->load(Yii::$app->request->post()) && $model->save()) {
  12. return $this->redirect(['view', 'id' => $model->id]);
  13. } else {
  14. return $this->render('update', [
  15. 'model' => $model,
  16. ]);
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement