Error : Include(Require.php): Failed To Open Stream: No Such File Or Directory

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 !

Hi Chung,

It’s only a guess, but you might have an error in your “ChangePasswordForm.php” … probably around “rules” method.

Don’t you have a type of “require” in place of “required”?

Hi,

please check your php file spelling.

your class name is


ChangePasswordForm class

and your file name is


ChangePaswordForm.php

please rename the


ChangePasswordForm.php

it’s solved :rolleyes:

Thanks, MaggieQ and softark !

I’m sorry to disturb both of you.

I found the reason is my source code file character code which have both source code in UTF-8 and Japanese.

It’s solved