<?php
/*
example usage for TemplateEngine class.
*/
include_once "TemplateEngine.inc.php"; // Class file inclusion
$TempleteEngine = new TemplateEngine("TENG"); // Constructor with place holder prefix as argument.
$HL = array();
/* Values are being replaced with place holders.
Extra place holders in html file will be replaced, even if the values are not supplied.
*/
$HL['[TENG_Title]'] = "Page title";
$HL['[TENG_Alert]'] = "Please provide value";
$HL['[TENG_FormAction]'] = "http://www.example.com";
$HL['[TENG_ButtonLabel]'] = "Continue...";
$HL['[TENG_Example]'] = "TemplateEngine";
print $TempleteEngine->LoadTemplate("php.html",$HL); // Loading and processing html template
?>
|