A
A
atis //2016-07-04 10:33:54
Yii
atis //, 2016-07-04 10:33:54

Is it correct to pass Models to View?

Hi all.
In yii2, the data is transferred as follows. way.
The controller "pulls" the Model(s) and passes the data to the View. Is it correct?
After all, the Controller should not know about the implementation of the View (and we pass an array containing this data one way or another) I pass the Model to the View + the data that came to the Controller, and the View itself "pulls" the Model. How true? [ 'productList' => [], 'title' => '', ...]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Skrolea, 2016-07-04
@atis2345

So the controller does not know how the view is implemented - it just gives the data for the view and that's it. Which takes from the model. Correctly it is Model -> Controller -> View

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question