|
|
|
|
|
by jasonlotito
5439 days ago
|
|
I think there is confusing when you say a view shouldn't have to ask for data. Regardless of how that data is given, at some point, the view has to ask for data. It has to attach itself to some aspect of that data, or it has to print out the data, or whatever depending on the language. Basically, there is no difference between: <?php echo $data['email']; ?>
And <?php echo $data->getEmail(); ?>
Both are asking for the email.Take your list code in HTML example. You can easily create a view that asks for data from a model, and simply ensure that the model always uses the same interface. Now, any model that should be listed has the same interface the view can access. Views shouldn't be running actions on the model, of course. But it makes no sense to take data from a model, compile it up, and send it over to the view, when you can simply send the model to the view. |
|