concept template in category php

This is an excerpt from Manning's book PHP in Action: Objects, Design, Agility.
If a type hint is too specific, it may be too restrictive. For example, the display() method might be able to use objects that are not Templates. For example, it might be able to accept a Redirect object that would do an HTTP redirect instead of generating HTML code as templates habitually do. It can be useful to have some freedom in how restrictive the type hint becomes. A class cannot extend more than one class, but interfaces are unlimited; this allows us to express abstract relationships that fall outside the inheritance hierarchies. To express the similarity between a Redirect object and a template object—the fact that they are interchangeable in some contexts—we can use an interface called something like Response:
$template = new PHPTAL_Template('message.html'); $template->set('message','Hello world'); echo $template->execute();
In this chapter, we start by discussing the reasons why we want to separate presentation from the rest of the application and how templates can help us do that. Then we study some template engines and compare how they work. We also take a close look at XSLT, which may be used as a template engine. Then we go through some further techniques for keeping program logic out of templates. Finally, we’ll see how to make sure templates don’t compromise security.
A template in our context is a web template—a page written in a language that consists mostly of HTML markup, but also has a way of expressing how dynamically generated content is to be included. A template engine is a software library that allows us to generate HTML code from the templates and specify the dynamic content to be included.