WAMP环境下测试的.
模板文件test.html内容:
<html>
<head>
<meta http-equiv='Content-type" content="text/html;charset=utf-8">
<title><{-$title-}></title>
</head>
<body>
<{-$name-}>
</body>
</html>
init.inc.php文件内容:
<?php 
define("ROOT",str_replace("\\","/",dirname(__FILE__)).'/');
require ROOT.'/libs/Smarty.class.php';
$smarty=new Smarty();
$smarty->setTemplateDir(ROOT.'templates/')
->setCompileDir(ROOT.'templates_c/')
->setPluginsDir(ROOT.'plugins/')
->setCacheDir(ROOT.'cache/')
->setConfigDir(ROOT.'configs/');
$smarty->caching=false;
$smarty->cache_lifetime=60*60*24;
$smarty->left_delimiter='<{-';
$smarty->right_delimiter='-}>';
?>
index.php文件内容:
<?php 
ini_set("display_errors","On"); error_reporting(E_ALL);
require 'init.inc.php';
$smarty->assign("title","测试用的网页标题");
$smarty->assign("name","汪雨航");
$smarty->display("test.html");
?>
浏览器里打开index.php显示空白,什么都没有,而templates_c目录下也文件,了请问是什么情况?