After some research in the source and reading the api I’d like to discuss if the CWidget class shouldn’t have a createUrl() implementation like CController but appending to the action automatically the $prefixUrl. I think it could be very useful
Sure, but for commodity when you’re in widget view, usually referring to widget contributed actions (actions declared in function actions() {…}, that will be prefixed in main controller), maybe people would like to write $this->creteUrl(‘widgetAction’);
Well, currently I’m missing that functionality and indeed I have written a superclass like this:
class Widget extends CWidget {
public function createUrl($action,$params=array(),$ampersand='&') {
return $this->getController()->createUrl($this->actionPrefix.$action, $params, $ampersand);
}
}