Template-Based Web Development With patTemplate (part 2) - Brain Dump (
Page 11 of 14 )
Finally, if you're having
problems with the engine, you can use the dump() method to view detailed
debugging information on the template engine. Take a look at the following
example, and its output:
<?php
// include the class
include("include/patTemplate.php");
// initialize an object of the class
$template = new patTemplate();
// set template location
$template->setBasedir("templates");
// set name of template file
$template->readTemplatesFromFile("music.tmpl");
// assign values to template variables $template->AddVar("footer",
"COPYRIGHT", "This material copyright Melonfire, " . date("Y",
mktime()));
// dump template information
$template->dump();
?>
Here's what the output looks like:

The dump() method displays information about the
available templates in the engine, the values of local and global template
variables, a list of template attributes, and a list of unused variables. It
provides an easy way to see how the template engine has processed your
templates, and to identify and correct errors that may have occurred in your
business logic.