- 论坛徽章:
- 0
|
在smarty.php中有如下代码:
include_once('../Smarty/Smarty.class.php');
$smarty = new Smarty();
$smarty ->template_dir = "../templates/"; //设置模板目录
$smarty ->compile_dir = "../souces/news/"; //设置目编辑目录
$smarty ->cache_dir = "../cache/"; //设置绶存
$smarty ->cache_lifetime = 60*60*24; //设置绶存时间
$smarty ->caching=false;
$smarty ->force_compile=true;//强制重新生成编译文件
$smarty ->left_delimiter = "<{"; //定义左定界符
$smarty ->right_delimiter = "}>"; //定义右定界符
在index.php文件中有如下代码:
include('../include/config.php');
header( "Content-Type: text/html; charset=utf-8 ");
include('smarty.php');
$WebTitle="页面标题";
$smarty->assign("WebTitle",$WebTitle);
$smarty -> display('news.htm');
在news.htm文件中如下代码:
<title>-<{$WebTitle}></title>
在本地测试和unix下使用都正常,但当在IIS6 windonws2003环境下,打开是标题是空白,什么也不显示。还来经查找原因是在souces/news/文件夹下没有生成%%6A^6AD^6AD15A0D%%news.htm.php这样一个编译文件,导至什么都不显示。把本机上的这个文件传到服务器上就能正常显示了。删除%%6A^6AD^6AD15A0D%%news.htm.php编译文件后,smarty不能够自动生成这样一个编译文件。现在求怎么样让smarty能够自已生成编译文件? |
|