Changing widget form action


I’d like to embed a form which originally was created for model A in other model action, say, B.

It is almost ok, just the problem accurs in form action where Yii automatically sets action to run as controller/action of model B. I read that action is set on beginWidget() method which runs init() method.

I did it by this code:

<div id="new_instance">    

<?php $model= new Instance(); $this->renderPartial('//instance/_form',array('model'=>$model)); ?>


So, the question is: is it possible to change form action? Or maybe there is another solution?



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


        'action' => Yii::app()->createUrl(....),  //<- your form action here


)); ?>

Thank you :)