Wiring MVC; View and Model

According to this answer, it seems that you can invoke a model from a view.

Is it possible to call a model from a view?

Now my question is: what will the wiring look like?

Will the controller pass the Factory model to the view? (Which, I think, would defeat the purpose of this question, since it would have to bypass the controller in order to do this if I don't get it wrong)

or

Will the view have a Factory model introduced into the view constructor before the view is passed to the controller?

+3
source share
1 answer

At first glance, I do not see a problem with this. Go through the alternatives:

  • Passing the original model into the view, enter hinting from the general model interface

    . , apis (, $model->getPerson($id), ), .

    - , .

  • , hinting

    , . . .

  • .

    , . .

, factory. , (, , factory). ( factory). , , factory.

, , factory ( ).

. , , , ...

+2

All Articles