What type of data should I send to view?
- by Vizualni
Hello,
this question I've been asking myself since the day I started programming in MVC way. Should I send to view arrays filled with data or should I send it as on objects I retrieved from database? My model returns me data as objects. What would be the best way to create such a thing?
$new_data = $model->find_by_id(1);
echo $new_data->name;
$new_data->name= "whatever";
$new_data->save();
For example.
view.php
echo $object->name;
or
echo $array['name']
Language is php :).