Help with widgets and partials, which one?

Hello everyone.

I am very happy with Yii, I’ve followed the Blog tutorial and I am starting my first project.

I am very confused between partials and widgets.

In the site’s design there is a section that is an advanced search. It is a collection of fields.

Which would be a better practicein this case? a widget or a partial?

Thank you.

I use widgets for parts that are used in most pages and do some general taska (menus, breadcrumbs, search and login). renderPatial is used for some common parts of 2 or 3 pages (content of tabs, some parts that will used as template for renderPartial in ajax requests). Anyway it’s only your decision.

Thank you fduch.

Is that it? a matter of taste?

Isn’t there a technical advantage or disadvantage for using a partial or a widget?

Like, maybe caching or better/worse performance or easier/more difficul to mantain?

Why did the Yii team came up with this two ideas?

Please foregive me with the questions, I want to understand.

Partial is just rendering a template, a widget is actually a class which may or may not actually render a template. It can also contain much logic within the widget class.

It’s 2 different things. renderPartial is method that render view without layouts, but widget is self-containing part of interface with own logic and view.

Thanks fduch, your answer is very clear to me.