Yii widget vs Yii Portlet?

Hello guys!

I want to know where is it appropriate to extend CWidget and where to extend CPortlet.

I have a multilingual site, in my case its with predefined number of languages - two, English and Bulgarian. I have already implemented the language change by get param, which sets the language to a COOKIE as well, but now I need a simple list of languages in header as flags, which are simple links to the page in the other language.

Here is where I get confused. In the blog tutorial all such small modules are well, "portlets" but when I browsed the extensions here, I found examples which are "widgets". As I see, both will do, but which is best practice in what situation?

When to extend CPortlet, when to extend CWidget?

Thank you!

Portlet is a Widget with some additional attributes: http://www.yiiframework.com/doc/api/CPortlet

If you don’t need them (title, hideOnEmpty, css…), then use a widget (as I usually do).