我尝试使用 Savant3,但总是出现相同的错误消息:
error, examine fetch() result
我的 wbx.php 包含:
session_start();
// include Savant class file
require_once 'lib/Savant3.php';
require_once 'lib/gemel.php';
// initialize template engine
$savant = new Savant3();
// assign template variables
$gemel = new Gemel;
$savant->aliasRead = $gemel->getAlias($username, $domain);
// interpolate variables and display template
$savant->display('template/test.tpl');
我的 tpl 是一个简单的 html 模板。
如果我在 wbx.php 中尝试 var_dump('$savant->aliasRead');
它可以工作,所以是我的模板创建了此错误。
位置正确,我的 tpl 在模板中/
但是不起作用,不明白为什么......
最佳答案
也许将 Savant3 对象构造为:
$config = array(
'template_path' => array('template')
);
$savant = new Savant3($config);
关于php - Savant3 模板引擎错误,检查 fetch() 结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16694164/