controllers/AppController.php
/**
     * Updates an existing Users model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     * @throws NotFoundHttpException if the model cannot be found
     */
Updates an existing Users model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed
@throws NotFoundHttpException if the model cannot be found
Updates an existing Users model . If update is successful the browser will be redirected to the ' view ' page . @param integer $id @return mixed @throws NotFoundHttpException if the model cannot be found
public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        $modelPass = new ChangePasswordForm($id);
        if ($model->load(Yii::$app->request->post())){
            $model->nacimiento=Yii::$app->formatter->asDate($model->nacimiento, "yyyy-MM-dd");
            if($model->save()){
                return $this->redirect(['show']);
            }
        }
        return $this->render('update', [
            'model' => $model,
            'modelPass' => $modelPass,
            'id' => $id,
        ]);
    }
public function actionUpdate ( $ id ) { $ model = $ this -> findModel ( $ id ) ; $ modelPass = new ChangePasswordForm ( $ id ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) ) { $ model -> nacimiento = Yii :: $ app -> formatter -> asDate ( $ model -> nacimiento , " yyyy-MM-dd " ) ; if ( $ model -> save ( ) ) { return $ this -> redirect ( [ 'show' ] ) ; } } return $ this -> render ( 'update' , [ 'model' => $ model , 'modelPass' => $ modelPass , 'id' => $ id , ] ) ; }
Updates an existing Users model.
Updates an existing Users model .
//\Yii::$app->session->setFlash('success', 'Usuario modificado correctamente');