A free and open-source book on ZF3 for beginners


4.24. Summary

A Zend Framework 3 based website is just a PHP program receiving an HTTP request from the web server, and producing an HTTP response. The web application uses the Model-View-Controller pattern to separate business logic from presentation. The goal of this is to allow for code reusability and separation of concerns.

A controller is a mediator between the application, models and views: it gets input from HTTP request and uses the model(s) and the corresponding view to produce the necessary HTTP response. A controller is a usual PHP class containing action methods.

Views are simple HTML+PHP code snippets producing HTML output returned by the web server to site visitors. You pass the data to view scripts through the ViewModel variable container.

A model is a PHP class which contains the business logic of your application. The business logic is the "core" of your website which implement the goal of site operation. Models can access database, manipulate disk files, connect to external systems, manipulate other models and so on.


Top