我真的找了一遍,但什么也没找到。
我是template lite的新手。我添加了我的项目template_lite库,我有两个文件。
test.php是:
require("../src/class.template.php");
$tpl = new Template_Lite;
$tpl->assign("foo","bar");而test.html是
<html>
<head>
<title>Document Title</title>
</head>
<body>
{$foo}
</body>
</html>错误之处在于输出:"{$foo}"
发布于 2012-02-07 00:17:24
根据documentation,您需要设置两个变量:
在加载模板精简版后,需要设置两个变量:$template_dir和$compile_dir。
require('/path/to/class.template.php');
$tpl = new Template_Lite;
$tpl->compile_dir = "compiled/";
$tpl->template_dir = "templates/";https://stackoverflow.com/questions/9169077
复制相似问题