<?php
require_once("HTML/Template/IT.php");
$template = <<<EOF
<!-- BEGIN a -->
Hello {username}
<!-- END a -->
Welcome to {page},
You are visitor number {visitorcount}.
EOF;
$tpl = new HTML_Template_IT('.');
$tpl->setTemplate($template);
// set the {page} variable. It will be returned by getGlobalvariables then.
$tpl->setVariable("page", "http://example.com");
$tpl->setVariable("username", "foo");
// getGlobalvariables won't return {username} as it is not a global variable
// It won't return {visitorcount} as it is not set
print_r($tpl->getGlobalvariables());
?> |