<?php

//Base class for generating html code from
//given template file
class Rad_Template
{
    protected $templatesDir = "templates";

    public function __construct($templatesDir = "")
    {
        if ($templatesDir != "") {
            $this->templatesDir = $templatesDir;
        }

    }

    public function rad_SetWorkingDirectory($dir)
    {
        $this->templatesDir = $dir;
    }

    public function rad_GetTemplate($file, $vars = array())
    {
        ob_start();
        require rad_path_combine($this->templatesDir, $file) . ".php";
        return ob_get_clean();
    }

}
