Changing widget form action

Hi,

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)); ?>

</div>

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

Thanks,

BarBQ




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

        'id'=>'form-id',

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

      

)); ?>




Thank you :)