<?php
/*
* This is the example script of how to use cTemplate.php
* this has two exapmles, one is to show how to make a templte
* from string and the second is to show how to use a template file
*/
require_once("cTemplate.php");
$tpl = new cTemplate();
# String Template
$templatestring = "Hello {NAME}, You have {NUMBERMAILS} new messages";
# Template in a file
$templatefile = "dashboard.tpl";
$tpl->setvar("NAME", "laudarch");
$tpl->setvar("NUMBERMAILS", "10");
# show template from string
print $tpl->gettpl($templatestring);
# show template from file
print $tpl->gettpl_file($templatefile);
?>
|