smarty输出php,php – Smarty输出空白页面

求助:模板文件出错

我有这样的Smarty设置:

require_once 'smarty/Smarty.class.php';

$smarty = new Smarty();

$smarty->compile_dir = $compile_dir;

$smarty->template_dir = $tpl_dir;

这就是我现在应该需要的……我为其他网站设置了完全像这样的Smarty,它在同一台服务器上工作得很好.

var_dump($smarty)输出所有公共变量,$smarty-> template_exists(“index.tpl”)返回1,这两者都表明Smarty已正确设置并正常工作,但是,$smarty-> display(“ index.tpl“)和$output = $smarty-> fetch(”index.tpl“); echo $output;输出空白页面. index.tpl文件肯定包含HTML.

我忘记了一些步骤还是什么?

编辑:

添加

ini_set('display_errors', true);

error_reporting(E_ALL + E_NOTICE);

还为Smarty创建了配置目录.

并试过$output = $smarty-> fetch(“index.tpl”);后续代码var_dump($输出).

还是空白页面.

如果我回应“foo”;在$smarty-> display(“index.tpl”)之前它会输出该行,但是如果我在它之后执行它,它就不会输出它.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值