2011-10-10 51 views
1

显示方法不能正常工作打印“kamal”不打印“maisuriya”在Smarty显示方法不起作用

请帮帮我吗?

print("kamal"); 
$tpl->display('default_layout'. $config['tplEx']); 
print("Maisuriya"); 
+0

'$ tpl-> display'调用失败了吗?有没有错误输出? – spraff

回答

2

如果你没有看到任何错误讯息,您可能希望与ini_set("display_errors", true); error_reporting(E_ALL);

如果您使用Smarty3运行$tpl->testInstall();后,你已经设置的Smarty,看是否要激活它们(暂时)一切都好。然后检查您的模板是否存在$tpl->templateExists('default_layout'. $config['tplEx']);

我的猜测是所请求的文件不存在,或者模板包含语法错误,或者模板中调用的某些函数未正确执行。但没有错误信息,我不知道。