I have several objects and a “template” to display these objects in:
Name: $name Description: $description Price: $price Picture: $image
Since the number of objects varies, how can I display these according to the MVC pattern? Should I wrap the template in a function and call it for each object?
please yell at me if I’m misinterpreting the question, but if I’m not, I would create a class DisplayItem, and have it play as a model to plug the object data into, and hand the list or array of displayItems over to the View.