I have a form where i am updating. its url looks like this
i have defined a cancel button in that form,
<?php echo CHtml::Button(‘Cancel’,array(‘submit’=>‘cancel’));?>
when i hit cancel, it keeps going to this url.
where as it should goto
I do not want to hard code. how can i do this ?
Initiate a GET request with a single link. From a designer’s perspective, it’s even more acceptable to create links instead of buttons when there are no changes on server-side.
How do I do this ? And when you say Link, do you mean, the anchor element ?
Yes, as simple as an anchor item.
I do not want to use a link.
I want a proper html button with the ability to cancel the current form and move back to the previous controller function.
<?php echo CHtml::Button('Cancel',array('submit'=>array('cancel')));?>
Superb. It works like magic.
Now can you pleaes explain, what is the principle of putting an array inside an array ? How does the yii framework parse it ?