Hi…
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;
$criteria->compare('notificationTitle',$this->notificationTitle,true);
This works perfectly. How will i deploy a form in view and how can i get the values in controller?
Possible View ? :
<?php
$form = $this->beginWidget('CActiveForm', array(
'action' => Yii::app()->createUrl($this->route),
'method' => 'post',
));
echo $form->textField($model, 'notificationTitle', array('class' => 'field'));
$this->endWidget();
?>
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?