gpt4 book ai didi

php - Savant3模板引擎错误,检查fetch()结果

转载 作者:行者123 更新时间:2023-12-03 07:42:15 25 4
gpt4 key购买 nike

我尝试使用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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com