2 class TemplateService {
5 function &getInstance() {
8 $instance =& new TemplateService();
12 function TemplateService() {
13 $this->basedir = $GLOBALS['TEMPLATES_DIR'];
16 function loadTemplate($template, $vars = NULL) {
17 if (substr($template, -4) != '.php')
19 $tpl =& new Template($this->basedir .'/'. $template, $vars, $this);
30 function Template($file, $vars = NULL, &$templateservice) {
33 $this->templateservice = $templateservice;
37 if (isset($this->vars))
42 function includeTemplate($name) {
43 return $this->templateservice->loadTemplate($name, $this->vars);