© Christopher Pitt 2021
C. PittPro PHP 8 MVChttps://doi.org/10.1007/978-1-4842-6957-2_4

4. Building a Template Engine

Christopher Pitt1  
(1)
Verbena Close 1, Stellenberg, Durbanville, Cape Town, South Africa
 

In the last chapter, we spiced up Whoosh’s routing, by reorganizing our first bit of routing code into a set of reusable classes and patterns. Now, it’s time to turn our attention toward presenting better interfaces.

There are many different approaches to templating. It’s a polarizing topic, where disagreements usually come down to where the line is drawn between code that renders HTML and the rest of the code.

I don’t want to get into which approach is best, because in the end “which is best?” can usually only be answered by “it depends.” Instead, ...

Get Pro PHP 8 MVC: Model View Controller Architecture-Driven Application Development 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.