Stucked with Yii Framework Form tutorial

[font="Arial,"][size="4"]I keep on reading this tutorial of Yii framework over and over again Yii Framework Form Tutorial[/size][/font]

[font="Arial,"][size="4"]I already created my Model with this following codes[/size][/font]


class LoginForm extends CFormModel{

    public $username;

    public $password;

    public $rememberMe = false;

    private $_identity;

    public function rules(){

        return array(

            /* array(,,)

            * functions required and boolean are built-in validators of the yii framework.

            * you can invoke your own function by defining your own function







    public function authenticate(){

        $this->_identity = new UserIdentity($this->username,$this->password);


            $this->addError("password","Incorrect Username or Password");



    public function attributeLabels(){

        return array(



            'rememberMe'=>"Remember Me",





[font="Arial,"][size="4"]and my Action function with this codes in my controller[/size][/font]


public function actionLogin(){

            //calls the Login Model that will be used in this action

            $model = new LoginForm;


                //collects user input

                $model->attributes = $_POST["LoginForm"];

                //validates user input using the model rules and redirects back to

                //previous page when user input is invalid




                //redisplay the login form





[font="Arial,"][size="4"]and lastly my view[/size][/font]



<div class="form">


        $formlogin = $this->beginWidget('CActiveForm'); 	

        echo $formlogin->errorSummary($model);

    ?>            $formlogin = $this->beginWidget('CActiveForm'); 	

        echo $formlogin->errorSummary($model);


















   						echo CHtml::submitButton('Login');








[font="Arial,"][size="4"]and i always came out with this error[/size][/font]


Undefined variable: model


[font="Arial,"][size="4"]do i miss something? please let me know… I know this is kinda simple but I am a first-timer in using such component-based MVC frameworks… Thanks[/size][/font]


on controller

/redisplay the login form



/redisplay the login form



I try your code and i fell in this error

include(password.php) [[url="function.include"]function.include[/url]]: failed to open stream: No such file or directory


i think there is no such a file in framework. may be you installed some extensions or included some files, but haven’t created 'em?

or you are missing quotes near password validator or other string in your code

sorry for taking your time… anyways i got it… i forgot to pass my model instance to my view using my controller’s render function… thank you thank you