<?php
/**
*
*author: Jim Martens
*Erstellung meiner Template-Klasse
*
*/
//Definition der template-Klasse
class template
{
//Variablen, die über die ganze Klasse benötigt werden
var $_tpldata = array('.' => array(0 => array()));
var $_rootref;
var $root_path;
var $root = '';
var $template_path = 'templates/';
var $files = array();
var $filename = array();
var $inherit_root = '';
var $files_inherit = array();
var $files_template = array();
function assign_vars($vararray)
{
foreach ($vararray as $key => $val)
{
$this->_rootref[$key] = $val;
}
return true;
}
function set_filenames($filename_array)
{
if (!is_array($filename_array))
{
return false;
}
foreach ($filename_array as $handle => $filename)
{
if (empty($filename))
{
trigger_error("template->set_filenames: Empty filename specified for $handle", E_USER_ERROR);
}
else
{
$this->filename[$handle] = $filename;
$this->files[$handle] = $this->root . '/' . $filename;
}
}
return true;
}
}
?>