Example #1
0
 /**
  * Updates an existing DctAge model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     $model = $this->findModel($id);
     $languages = $this->getLanguages();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         $params = Yii::$app->request->post();
         DctAgeLoc::saveLocalizationData($model, $params, count($languages));
         return $this->redirect(['view', 'id' => $model->dct_age_id]);
     } else {
         return $this->render('update', ['model' => $model, 'languages' => $languages, 'modelLoc' => DctAgeLoc::getLocalizationData($id)]);
     }
 }