<?php
//
// Raw Template Engine - the template engine using row php.
//
// Copyright (C) 2005 Masaki Komagata <komagata@p0t.jp> 
//     All rights reserved.
//     This is free software with ABSOLUTELY NO WARRANTY.
//
// You can redistribute it and/or modify it under the terms of 
// the PHP License, version 3.0.
//
class Raw {
	var $template_dir = "templates/";
	var $template_vars = array();
	function assign($name, $value) { $this->template_vars[$name] = $value; }
	function assign_by_ref($name, &$value) { $this->template_vars[$name] =& $value; }
	function display($template) { echo $this->fetch($template); }
	function fetch($template) {
		extract($this->template_vars);
		ob_start();
		include($this->template_dir.$template);
		$result = ob_get_contents();
		ob_end_clean();
		return $result;
	}
}