【问题标题】:Smarty 3 template from outside templates folder来自外部模板文件夹的 Smarty 3 模板
【发布时间】:2013-06-08 12:22:23
【问题描述】:

我对以前的 smarty 版本一直在做同样的事情......就像在指定的模板文件夹之外加载一个 TPL 文件,像这样:

$smarty->display("../admin/bin/tpl/default.tpl");
exit();

但是自从升级后,我收到以下错误:

[12-Jun-2013 11:40:12 UTC] PHP Fatal error:  Uncaught exception 'SmartyException' with message 'Unable to load template file '../admin/bin/header.tpl' in '../admin/bin/tpl/default.tpl'' in 

【问题讨论】:

    标签: php smarty smarty3


    【解决方案1】:

    你试过绝对路径吗?即

    $smarty->display("/var/www/mywebsite.com/templates/admin/bin/tpl/default.tpl");
    

    这应该根据the manual 工作(它对我有用)

    【讨论】:

    猜你喜欢
    • 2017-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-02
    • 1970-01-01
    • 1970-01-01
    • 2012-06-19
    • 1970-01-01
    相关资源
    最近更新 更多