Hi,
I have a ChangePasswordForm class, that is decleared in ChangePaswordForm.php file like the followings:
class ChangePasswordForm extends CFormModel{
public $old_passwd;
public $new_passwd;
public $repeat_passwd;
....
}
in password action:
public function actionPassword(){
$model = new ChangePasswordForm;
if (isset($_POST['ChangePasswordForm'])) {
$model->attributes = $_POST['ChangePasswordForm'];
if($model->validate()){
$user = $this->loadModel(Yii::app()->user->id);
$user->password= $user->hashPassword($model->new_passwd);
$user->save();
}
}
$this->render('password',array('model'=>$model));
}
When render into view. I var_dump model and have the result:
object(ChangePasswordForm)#23 (<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/cool.gif' class='bbc_emoticon' alt='8)' /> { ["old_passwd"]=> NULL ["new_passwd"]=> NULL ["repeat_passwd"]=> NULL ["_errors":"CModel":private]=> array(0) { } ["_validators":"CModel":private]=> NULL ["_scenario":"CModel":private]=> string(0) "" ["_e":"CComponent":private]=> NULL ["_m":"CComponent":private]=> NULL }
but after submit form I got the warning:
and in trace, i found the problem when including ChangePasswordForm.php file
I try to copy & paste this class name and file name many time, but it’s not work
Is any body help ? Thanks !