modified to use the TemplateInterface (PhpTemplate).