Review and next steps

We have now gone through all of our page scripts and extracted the presentation logic to a series of separate files. The presentation code is now executed in a scope completely independent from the page script. This makes it very easy for us to see the remaining logic of the script, as well as test the presentation logic independently.

With the presentation logic extracted to its own layer, our page scripts are dwindling in size. All that remains in them is some setup work and the action logic needed to prepare a response.

Our next step, then, is to extract the remaining action logic from our page scripts to a series of controller classes.

Get Modernizing Legacy Applications in PHP 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.