Hour 24. Toward a Framework for Larger Projects

What You’ll Learn in This Hour:

  • How to manage client requests with a controller class

  • How to find and run command classes based on a client request

  • How to select and serve views based on the return value of a Command class

  • How to implement views that work with the wider framework

With the introduction of PHP 5, there has been an explosion of interest in object-oriented design for PHP. There has been much debate about the relevance to PHP of design patterns developed in the context of strongly typed object-oriented languages such as C++ and Java. In this chapter we sidestep the theoretical discussion and look under the hood of a simple open-source PHP implementation of the Front Controller pattern. ...

Get Sams Teach Yourself PHP in 24 Hours, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.