Property "Report.date1" is not defined.

Saya ingin bertanya ni buat para master2 yii disini karena saya pengguna baru dalam yii.

pada saat saya ingin membuat form pencarian, muncul error Property "Report.date1" is not defined.

code pada model Report.php




public function rules()

	{

		// NOTE: you should only define rules for those attributes that

		// will receive user inputs.

		return array(

			array('date_last_update', 'required'),

			array('date1, date2','length','max'=>50),

			array('date1, date2, date_last_update, 'safe', 'on'=>'search'),

		);

	}




trus saya buat di ReportController.php




public function actionReport()

	{

		$data=new Report;

		if(isset($_POST['Report']))

		{

			$this->render('allReport',array('model'=>$data));

		}

		else

		{

			$this->render('allReport',array('model'=>$data));

		}

	}



ini buat di view allReport.php




<?php 

	//echo Yii::app()->getRequest()->getBaseUrl()."/index.php?r=site/page&view=about";


	$form=$this->beginWidget('CActiveForm', array(

	'id'=>'report-form1',

	'enableClientValidation'=>false,

	'clientOptions'=>array(

		'validateOnSubmit'=>true,

	),

)); ?>    

	<div class="row">

		<?php echo $form->label($model,'Tanggal	:'); ?>

		<?php echo $form->textField($model,'date1',array('size'=>20,'maxlength'=>20)); ?> <--errornya  disini

        <?php echo $form->textField($model,'date2',array('size'=>20,'maxlength'=>20)); ?> <--errornya  disini

	</div>

    

    <div class="row buttons">

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

	</div>


<?php $this->endWidget(); ?>



tolong bantuannya, karena saya dah mencoba date1 dan date2 di tulis di model, tetapi masuh error juga.

Cannot understand what you have written but from code this is what I get.

Having a property in rules function does not mean that the corresponding field exists in database. Check if date1 and date2 exist in table. Also check your "attributeLabels" function. It should have a key/value pair for date1 and date2.