CHAPTER 2

images

Foundation

We will begin our framework by looking at some foundational (OOP-focused) code on which the core components will be based. The first thing we will look at is how to execute code that is spread over multiple files. We will also look at what to do when we encounter errors. Finally, we will create a convenient means of sorting and retrieving class metadata.

Goals

  • We need to develop a means to load classes automatically. Classes should be located based on their names, and these names should translate into a folder hierarchy.
  • We need to understand and define custom Exception subclasses, so that we can handle the most common ...

Get Pro PHP MVC 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.