Search not working in some place
in modal:-
public function search()
{
// @todo Please modify the following code to remove attributes that should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('id',$this->id);
$criteria->compare('name',$this->name,true);
$criteria->with= array('c');
$criteria->compare('c.c_name', $this->Course , true);
$criteria->with= array('l');
$criteria->compare('l.book', $this->Book, true);
$criteria->compare('email',$this->email,true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
in admin:-
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'student-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'id',
'name',
array(
'name'=>'Course','value'=>'$data->c->c_name'
),
array(
'name'=>'Book','value'=>'$data->l->book'
),
'email',
array(
'class'=>'CButtonColumn',
),
),
)); ?>
but search is working for name id email but it is not working for book and course.