Template Systems
For some time now, PHP developers have been using different template systems to separate their PHP code (the logic of a page) from the HTML design (the look). The two popular methods were either included files—which I covered in Chapter 3, “Creating Dynamic Web Sites”—and object-oriented programming systems like FastTemplate.
The recently developed Smarty has dramatically improved upon these options by creating a template system that also compiles into static pages. In other words, the resulting HTML page can be made one time and then updated only as warranted by database changes. The further advantage of using Smarty is that it’s structured so that PHP logic can be placed within the template itself.
Smarty is an official part ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access