<?php

                   //Smarty_extends.class.php

	require_once('includes/smarty/Smarty.class.php');					//包含smarty类文件

	/**

	 * class Smarty_extends

	 *

	 * Description for class Smarty_extends

	 *

	 * @author:王康

	*/

	class Smarty_extends extends Smarty{



		/**

		 * Smarty_extends constructor

		 *

		 * @param 

		 */

		function Smarty_extends() {

			$template_name = 'TemplateDemo';								//模版文件夹名

			$this->compile_check = true;									//打开模版编译检查

			$this->debugging = false;										//关闭调试

			$this->caching = false;										//关闭缓存

			$this->template_dir = "template/{$template_name}/";			//设置模版路径

			$this->compile_dir = 'template_c';								//设置编译文件存放的文件夹

			$this->left_delimiter = '{{';									//设置左边界符

			$this->right_delimiter = '}}';									//设置右边界符号

			$this->assign('Name' , 'Smarty模板程序!');					//smarty方法,用来把模板里的{{$Name}}部分用变量'Smarty模板程序!替换。

		}

	}

?>



<?php

	require_once('Smarty_extends.class.php');

	$smarty=new Smarty_extends();

	$smarty->display('Demo.tpl');

?>

posted on 2008-06-14 17:11  wkjs  阅读(199)  评论(0编辑  收藏  举报