<?php define('SMARTY_TMP_DIR','C:/php5/Smarty-2.6.13/'); define('SMARTY_DIR','C:/php5/Smarty-2.6.13/libs/'); //SMARTY_DIR ->smarty keyword,must be defined as libs dectory require_once(SMARTY_DIR.'Smarty.class.php'); //建立一个smarty对象 $smarty = new Smarty; $smarty->template_dir = SMARTY_TMP_DIR.'templates/'; $smarty->compile_dir = SMARTY_TMP_DIR.'templates_c/'; $smarty->config_dir = SMARTY_TMP_DIR.'configs/'; $smarty->cache_dir = SMARTY_TMP_DIR.'cache/'; //$smarty->left_delimiter = '{/'; //$smarty->right_delimiter = '/}'; //----------simple show example------------ //$smarty->assign('name','Porky'); //$smarty->display('smarty_test.tpl'); ?>