【问题标题】:Smarty3 Template Loading with Relative Path Using include file使用包含文件的相对路径加载 Smarty3 模板
【发布时间】:2016-05-27 14:01:38
【问题描述】:

当我使用包含文件包含文件时,我们的项目从 smarty 2 翻转到 smarty 3。 它返回

错误:无法加载模板。

它在 smarty 2 中工作正常,但在翻转后它在 smarty 3 中不工作有什么建议吗? 提前致谢

【问题讨论】:

    标签: php templates include smarty3 smarty2


    【解决方案1】:

    在实例化 Smarty 后尝试“testInstall”方法并设置目录,在本例中为“$smarty”:

    [...]
    $smarty->setTemplateDir('somedir/templates/');
    $smarty->setCompileDir('somedir/templates_c/');
    $smarty->setConfigDir('somedir/configs/');
    $smarty->setCacheDir('somedir/cache/');
    
    $smarty->testInstall();
    exit;
    

    【讨论】:

      猜你喜欢
      • 2011-05-16
      • 1970-01-01
      • 1970-01-01
      • 2011-12-08
      • 1970-01-01
      • 2013-04-09
      • 2014-11-15
      • 1970-01-01
      相关资源
      最近更新 更多