Thursday, November 13, 2014

MVC

It's crucial to study the MVC design pattern carefully because Shopware is based on MVC. Surely, if we get to know the concept right now, we'll get less into trouble later during the implementation. Here's a great post, but in German! In the following, I write down what I learned from the post:

Model:
provides data (either from the database or simple arrays) for the controller.

View:
is a layer between the controller and the template. The view receives the data from the controller and embeds them in the template. What user sees in the browser is the content of the template in which the data are assigned to the variables.

Controller:
- Gets the parameters of the request.
- Gets the data from the database and send them to the view.
- Decides what template should be loaded.

No comments:

Post a Comment