Your IP : 216.73.216.95


Current Path : /var/www/alh/system/library/template/
Upload File :
Current File : /var/www/alh/system/library/template/template.php

<?php
namespace Template;
final class Template {
	private $data = array();
		
	public function set($key, $value) {
		$this->data[$key] = $value;
	}
	
	public function render($template) {
		$file = DIR_TEMPLATE . $template . '.tpl';

		if (is_file($file)) {
			extract($this->data);

			ob_start();

			require($file);

			return ob_get_clean();
		}

		throw new \Exception('Error: Could not load template ' . $file . '!');
		exit();
	}	
}