Chapter 4. Implementing with PHP: Templates and the Web

An object-oriented programming pattern that people often try to apply to Web programming is Model-View-Controller (MVC). MVC dictates that an application be separated into three components:

  • Model—The internals of the system that perform all the core business logic.

  • View—The piece that handles formatting all output of the system.

  • Controller—The piece that processes input and communicates it to the model.

MVC originated as a SmallTalk paradigm for building agile desktop applications in which a given business process can have multiple methods of receiving data and returning output. Most Web systems receive data in only a single fashion (via some sort of HTTP request), and at any rate, the ...

Get Advanced PHP Programming now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.