<?php
define('ROOT',str_replace("/","//",$_SERVER['DOCUMENT_ROOT']).'//');
define('LIB_SMARTY',ROOT.'libs//');
define('TEMPLATES',ROOT.'templates');
require_once(LIB_SMARTY.'Smarty.class.php');
$Smarty=new Smarty();
$Smarty->compile_check=true;
$Smarty->debugging=false;
$Smarty->template_dir=TEMPLATES;
$Smarty->config_dir=ROOT.'demo//configs';
$Smarty->compile_dir=ROOT.'demo//templates_c';
$Smarty->cache_dir=ROOT.'demo//cache';
$Smarty->left_delimiter='<%{';
$Smarty->right_delimiter='}%>';
?>
使用Smarty的简要配置
最新推荐文章于 2022-02-25 19:38:17 发布
本文介绍了一个使用PHP实现的Smarty模板引擎的基本配置过程。Smarty通过定义根目录、模板目录、编译目录等来确保页面渲染的高效进行。此外,还展示了如何设置左、右边界符,以及开启调试模式的方法。
4327

被折叠的 条评论
为什么被折叠?



