PHP: Including Smarty and initializing


class Smarty_Pics extends Smarty {
	var $domain = 'http://localhost/websites/test_67/';
	var $pagID = md5('test_id_12345');
	function Smarty_Pics () {
		$this->Smarty();
		$this->template_dir = 'D:/workspace/test_67/libs/templates/';
		$this->compile_dir  = 'D:/workspace/test_67/libs/templates_c/';
		$this->cache_dir		= 'D:/workspace/test_67/libs/cache/';

		$this->assign('copyright','Copyright this');
		$this->assign('baseurl',$this->domain);
		$this->assign('pagID',$this->pagID);
		$this->assign('title','Test Title');
		
		$this->security = true;
		$this->security_settings = array(
			'PHP_HANDLING' => false,
			'IF_FUNCS' => array('array', 'list',
								'isset', 'empty',
								'count', 'sizeof',
								'in_array', 'is_array',
								'true', 'false', 'null'),
			'INCLUDE_ANY' => false,
			'PHP_TAGS' => false,
			'MODIFIER_FUNCS' => array('count'),
			'ALLOW_CONSTANTS' => false
		); 
		$this->caching = true;
		$this->cache_lifetime =  3300;
		//$this->php_handling = SMARTY_PHP_REMOVE;
		//$this->debugging	= true;
		//$this->debug_tpl	= 'C:/site_root/pear/debug.tpl';
				
		$this->register_block('nocache', 'smarty_block_nocache', false);
	}
}
$tpl = new Smarty_Pics();

click here to add a comment