[Help] Try To Add Login Form Not From Template, White Blank Page

Hi All, Im newbie for Yii,

I have try to create Login Form manually, (Not From the General Template).

I want show the Login Form on Fist page.

the Script For Model -> Login_model.php


class Login_model extends CActiveRecord


  public static function model($className = __CLASS__)


    return parent::model($className);

  }//end fucntion


  public function tablename()


    return 'user';

  } //end fucntion


  public function attributeLabels()


    return Array(





  }//end fucntion


  public function rules()


    return array(


       array('username','length','max'=>'10','filter','filter'=>array($obj=new CHtmlPurifier(),'purify')),

       array('password','length','max'=>'10','filter','filter'=>array($obj=new CHtmlPurifier(),'purify')),




  }//end fucntion






And for Controller -> LoginController.php


class LoginController extends Controller


	public $layout="NULL";


	public function actionIndex()




		$data = new Login_model;



		$data->username     =$_POST['Login_model']['username'];

                $data->password     =$_POST['Login_model']['password'];


		$list= Yii::app()->db->createCommand('select * from user where username=:username AND 



	 }//end isset   



	            using Session		






For View->index.php

<div class="form">

	<?php echo CHtml::beginForm(array('login/index'));

	      echo CHtml::errorSummary($data);



	<div class="row">

		<?php echo CHtml::activeLabel($data,'username');?>

		<?php echo CHtml::activeTextField($data,'username','');?>

    </div><!--end of row-->


	<div class="row">

		<?php echo CHtml::activeLabel($data,'password');?>

		<?php echo CHtml::activePasswordField($data,'password','');?>

    </div><!--end of row-->




	<div class="row buttons">

		<?php echo CHtml::submitButton('Log In');?>

		<?php echo CHtml::endForm();?>




</div><!--end of form-->

And it show only Blank White Page. The Apache Error Log File is show like this

PHP Fatal error:  Call to a member function getErrors() on a non-object in /var/www/septiyo/framework/web/helpers/CHtml.php on line 1592

Can Anyone Help me?

And if You have an Idea to create Login not From default Template, I am ready listen to your advice

Thanks For Advance.

Hi and welcome to Yii!

Did you pass the Login_model from your Controller to the view ?

for example at the end of the actionIndex you should add


thanks For Reply my Question.

Not Yet, but after I add your advice, the error is

Undefined variable: Login_model 


hey It Works, yeah I ForGet To do that. After I Add this Script the Form Show.


Thanks A Lot :D