示例#1
0
 public function actionEdit()
 {
     $user = $this->getUser();
     $model = new EditProfileForm();
     $model->attributes = $user->attributes;
     if (isset($_POST['EditProfileForm'])) {
         $model->attributes = $_POST['EditProfileForm'];
         if ($model->validate() && $model->update()) {
             Yii::app()->user->setFlash('success', Yii::t('common', 'Your profile has been updated successfully.'));
             $this->redirect(array('/user/profile'));
         }
     }
     $this->render('edit', array('user' => $user, 'model' => $model));
 }