[size="3"]Delete from your Event.php[/size]
* @property string $evenue
* @property string $econtact
[s] * @property string $name
*/
class Event extends CActiveRecord
{
[size="3"]Your rules function, search for name, search for type,size and content and delete everything you found. Here i searched for name and marked for you the 3 lines which needed to be edited.[/size]
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('size', 'numerical', 'integerOnly'=>true),
array('ename,
name,
type', 'length', 'max'=>30),
array('ename,etime,econtact,evenue,edate','required'),
array('econtact','match','not'=>false,'pattern'=>'/^[7-9]{1}[0-9]{9}$/','message'=>'Invalid Mobile'),
array('etime', 'length', 'max'=>5),
array('etime','match','not'=>false,'pattern'=>'/([0-1]\d|2[0-3])<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/sad.gif' class='bbc_emoticon' alt=':(' />[0-5]\d)/','message'=>'Invalid Mobile'),
array(‘name’, ‘file’,‘types’=>‘jpg, gif, png’, ‘allowEmpty’=>true, ‘on’=>‘update’),
array('evenue', 'length', 'max'=>50),
array('econtact', 'length', 'max'=>10),
array('edate, content', 'safe'),
// The following rule is used by search().
// @todo Please remove those attributes that should not be searched.
array('ename, edate, etime, evenue, econtact,
name,
type, size, content', 'safe', 'on'=>'search'),
array('ename', 'unique', 'on' => 'insert,update', 'message' => 'This event has already been created!'),
);
}
Delete in your
public function attributeLabels()
{
return array(
'ename' => 'Ename',
'edate' => 'Edate',
'etime' => 'Etime',
'evenue' => 'Evenue',
'econtact' => 'Econtact',
'name' => 'Name', #delete it
'type' => 'Type',#delete it
'size' => 'Size',#delete it
'content' => 'Content',#delete it
);
}
Furthermore
public function search()
{
// @todo Please modify the following code to remove attributes that should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('ename',$this->ename,true);
$criteria->compare('edate',$this->edate,true);
$criteria->compare('etime',$this->etime,true);
$criteria->compare('evenue',$this->evenue,true);
$criteria->compare('econtact',$this->econtact,true);
$criteria->compare('name',$this->name,true); #delete it
$criteria->compare('type',$this->type,true); #delete it
$criteria->compare('size',$this->size); #delete it
$criteria->compare('content',$this->content,true); #delete it
...