I am creating a change password functionality , in the change password form I need to use the password field thrice , but with different id , such as oldpassword,newpassword,repeatpassword . it doesn’t match my model structure, thats why I am using Cformmodel . I have created a model which extends the CFormModel and a view and rendering this view in my usercontroller.
==
public function actionChangepassword(){
$model=new ChangepasswordForm;
if(isset($_POST['ChangepasswordForm']))
{
$model->attributes=$_POST['ChangepasswordForm'];
if($model->validate())
{
$userid=Yii::app()->user->id;
}
}
$this->render('changepassword',array(
'model'=>$model,
));
}
once this change password form gets submitted , I want to update the user model to modify the password . I am not getting an
idea how I should do it .