How can I call createUrl in a view (Blog Portlet)

Hello all,

I created a class colors (extends Portlet) in the blog. And when I am trying to call $this->createUrl(…); in the view I have the following error:

Quote

colors does not have a method named "createUrl".

So it means that CWidget don't inherit and by the way has not createUrl method.

My question is : How can I call createUrl method in the view?

Many thanks in advance.

$this->getController()->createUrl() ?

Didn’t know that, thanks very much for your quick answer! :)

Or use Yii::app()->createUrl().

Ok thanks very much! :)