post to a different controller

i have a form i want to post to a different controller

ie /user/user/activation

how do i accomplish this

my form is similar to this and it is called from the user controller




<div class="form">

<?php echo CHtml::beginForm('activation-form','GET',array()); ?> 

	<div id="email">

	<?php echo CHtml::activeHiddenField($form,'email');  ?>

	</div>

        <div class="row_submit">

        <?php echo CHtml::submitButton(Yii::t("UserModule.user", "Activation")); ?>

	</div>

<?php echo CHtml::endForm(); ?>

</div><!-- form -->



Here’s how the declaration of beginForm looks like:


public static function beginForm($action='',$method='post',$htmlOptions=array())

Put something in the action, like ‘controller/action’.

You need to prepend the action with the controller if you want to call an action outside of current controller. :)

I will add something more to an already answered question (use Yii to create your action URLs):

CHtml::beginForm($this->createUrl(‘controller/action’),‘post’,array(‘id’=>‘frmlogin’));

To be slightly less verbose, this works:




CHtml::beginForm(array('controller/action'),'post',array('id'=>'frmlogin'));