how to specify a controller/action for a widget?

for example I have a widget that produce a form, and then I need an action/controller to handle it. Can I use an exist controller under protected/controller to handle the widget? meanwhile I save the widget under protected/components. And how to specify the controller for the widget?

thanks in advance…

Use CHtml::form() to send the form to any controller you want.

You don’t need something else.

Alright…thanks a lot, something like this, right?


<?php echo CHtml::submitButton('Publish', array('name'=>'publish','submit'=>'/page/action')); ?>

Nope, something like this:




<?php echo CHtml::form(Yii::app()->createUrl('some/controller'),'post');?>

<?php echo CHtml::submitButton('Publish',array('name'=>'publish'));?>

</form>