i have search action:
public function actionDoSearch()
{
$condition = null;
//if has title
if($_POST['title'])
$condition = 'sTitle($_POST[\'title\'])->';
//if has description
if($_POST['description'])
$condition .= 'sDescription($_POST[\'description\'])->';
//i don't know how to make danamic criteria to findAll
$items = Products::model()->sTitle($_POST['title'])->sDescription($_POST['description'])->with(array(
'items'=>array('condition'=>'items.visible=1'),
))->findAll();
$this->renderPartial('_items',array(
'items'=>$items,
));
}
please give me a idea,Thanks!
ps:sorry,post in wrong section.