Chtml::button submit controller probable bug

Seems like, if i just put my button like this.

<?php echo CHtml::Button(‘Cancel’,array(‘submi’=>‘user/cancel’));?>

it resolves to a url like this.

http://localhost/blog/user/cancel

but If i use this button instead,

<?php echo CHtml::Button(‘Cancel’,array(‘submit’=>‘index.php?r=user/cancel’));?>

then, it resolves fine. as per the example… here

http://www.yiiframework.com/doc/cookbook/48/

Is this how it should behave ?

With a Chtml::link, it seems to work really well and the actionCancel is perfectly called in the controller.

thanks

Arvind

Haven’t you configured path-style url format?

Yes… i just configured it and it seemed to work. I was wondering, if this could work in all styles not just path style. Or has this been designed to work specifically with path-style URL only. If so, then, the example page should state explicitly that this works with path-style only and a link to configuring the path style like this one => http://www.yiiframework.com/doc/guide/topics.url

thanks

Arvind

It actually generates all URLs in the style you defined.

If you disabled path format, links would be created as it is shown in the cookbook page.