Hello,
I’m making profile change but I have problem. When submit the form, it updates all my columns, not just this, who are in the form.
In the form I just have email, but it updates username, password, etc.
That’s my Profile action
public function actionProfile()
{
$id = (Yii::app()->user->isAdmin() and is_numeric($_GET['id'])) ? $_GET['id'] : Yii::app()->user->id;
$user=$this->loadUser($id);
if(isset($_POST['User']))
{
$user->setAttributes($_POST['User']);
//print_r($user->getAttributes());
//$user->attributes=$_POST['User'];
if(isset($_POST['submitUser']) && $user->save())
Yii::app ()->user->setFlash ( 'user', 'Успешно променихте профила!' );
}
$this->render('profile',array('user'=>$user));
}