简体   繁体   English

使用包含文件使用相对路径加载 Smarty3 模板

[英]Smarty3 Template Loading with Relative Path Using include file

Our Project Flipped from smarty 2 to smarty 3. when i am including a file using include file.我们的项目从 smarty 2 翻转到 smarty 3。当我使用包含文件包含文件时。 it returns它返回

Error : Unable Load template.错误:无法加载模板。

Its working fine in smarty 2 but after flipped its not working in smarty 3 any Suggestions?它在 smarty 2 中工作正常,但在翻转后在 smarty 3 中不起作用有什么建议吗? Thanks in advance提前致谢

Try 'testInstall' method and also setting the directories after you instantiate Smarty, in this example into '$smarty':尝试“testInstall”方法并在实例化 Smarty 后设置目录,在本例中为“$smarty”:

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

$smarty->testInstall();
exit;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM