[ Team LiB ] Previous Section Next Section

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. In plain English, that means we are going to look at some techniques for creating an object-oriented framework that could be used as the basis for larger PHP projects.

    [ Team LiB ] Previous Section Next Section