<?php
/*
	DevSaver web framework
	copyright (c) 2002-2018 DevSaver
		web:  www.devsaver.com
		mail: support@devsaver.com
*/

if (!defined("STPBase")) {
	die("This file can't be accessed directly!");
}

// dependencies


/**
* description
*
* @library	
* @author	
* @since	
*/
class CTemplateStatic{
	/**
	* description
	*
	* @param
	*
	* @return
	*
	* @access
	*/
	
	/**
	* description
	*
	* @param
	*
	* @return
	*
	* @access
	*/
	static function Replace() {

		$args = func_get_args();
		$tpl = $args[0];
		
		unset($args[0]);

		if (count($args)) {
			foreach ($args as $key => $val) {
				$tpl = new CTemplate($tpl , "string");
				$tpl = $tpl->replace($val);
			}		
		}
		
		return $tpl;
	}

	static function EmptyVars($tmp , $data = array()) {
		$template = new CTemplate($tmp , "string");

		if (count($data)) {
			$template->replace($data , false);
		}
		
		return $template->emptyvars();
	}

	/**
	* description
	*
	* @param
	*
	* @return
	*
	* @access
	*/
	static function ReplaceSingle($tmp , $var , $value) {
		return CTemplateStatic::Replace(
			$tmp , 
			array(
				$var => $value
			)
		);
	}
	
	
}

/*

History

0.2
	Saturday 15 September 2007
		Added BlockExists()

0.1
	Friday 03 August 2007
		Basic functionality
	
*/

?>