A
A
atis //2016-08-26 16:53:37
Yii
atis //, 2016-08-26 16:53:37

What is a widget in yii2?

Hello.
I can not understand what the widget means? It's not a view, but it's not a model either.
So far, I can say that this is a model that generates a view ... Maybe I'm wrong.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2016-08-26
@atis2345

Widget is a logically completed independent part of the interface. Widgets allow you to simplify your code, put it in a logical order, and reuse it. For example, a news list. You can place it on the main page of the site, as well as on the page of a product. If it is very conditional, then the widget is like a controller, the only action of which (run) renders some kind of view.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question