CHAPTER 3

images

Base Class

One of the excellent things about building an MVC framework, using OOP paradigms, is the ability for us to reuse code, with minimal effort. At any time, we might be required to add core functionality to the majority of our classes, and a good OOP base will help us to do this.

Imagine we build an application with our newly built framework, and we suddenly need to add new security measures across the whole application. We could make changes to every controller, invoking a repeated function, or referencing a shared function, but the best solution would be to add the shared functionality higher up the inheritance chain.

If all ...

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.