smarty使用

require('./libs/Smarty.class.php');

$smarty = new Smarty();
$smarty->left_delimiter="{";
$smarty->right_delimiter="}";
$smarty->setTemplateDir('templates');
$smarty->setCompileDir('compile');

$smarty->assign("a","123sdads");
$smarty->display('index.html');

-------------------------------------index.html-------------------

{$a}

---------------------------------------------------------------------

//引入lib和templates文件

猜你喜欢

转载自www.cnblogs.com/index0629/p/9098961.html