Search In Yii Cgridview


I want to implement a search and i kinda did it statically. How can i make it dynamic ?

My Controller :

        $this -> layout = 'main';

        $model->notificationTitle = 'test'; //Static Value which i want to make it dynamic like $_GET['keywords']; or something       

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

Model :

        $criteria=new CDbCriteria;


This works perfectly. How will i deploy a form in view and how can i get the values in controller?

Possible View ? :


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

                'action' => Yii::app()->createUrl($this->route),

                'method' => 'post',


         echo $form->textField($model, 'notificationTitle', array('class' => 'field')); 



I know the view is wrong since its already filled up by last content. My view is a list view done using cgrid view. The search is outside the cgrid view and how can i pass the value in the search box to controller?

I think you need to look at the filterSelector property.