samilo
(Samiloxphp)
February 11, 2013, 12:58pm
1
Hi All
I need to build search form and use it in all my site , so i used render partile but the problem is if i called it
data will send to current page and not return anything , I need to add something to action to call controller in form .
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'events-serach_block-form',
/// here missing code ?
'enableAjaxValidation'=>false,
));
?>
the code above in normal way that mean the view will call action in current controller that’s true ?
how to fix it and call controller to process data ?
Thanks in advance
Keith
(Kburton)
February 11, 2013, 1:11pm
2
I think you need to set the action attribute:
'action'=>array('searchcontrollerid/searchactionid'),
samilo
(Samiloxphp)
February 11, 2013, 1:28pm
3
Thanks , it’s work So if i need to convert it to widget just i can add
‘action’=>array(‘searchcontrollerid/searchactionid’),
or with widget something else ?
Keith
(Kburton)
February 11, 2013, 1:40pm
4
I’m not sure what you mean. If you want to wrap the whole search section in a widget then I expect you’d create an attribute in your widget to hold the action route and then pass that on to the CActiveForm widget. Have I misunderstood the question?