smarty目录有关问题
程序员文章站
2024-02-12 17:11:40
...
smarty目录问题
require("./Smarty/libs/Smarty.class.php");
$smarty=new Smarty;
$smarty->left_delimiter="{{";
$smarty->right_delimiter="}}";
$smarty->assign("main","./templates/a.html");
$smarty->display("./templates/xx.html");
?>
为什么这里$smarty->assign("main","./templates/a.html")就不可以,
$smarty->assign("main","templates/a.html");?和$smarty->assign("main","a.html");?都可以呢,目录结构是
xx.html
a.html内容
以下是目录结构
------解决方案--------------------
smarty 模板?
require("./Smarty/libs/Smarty.class.php");
$smarty=new Smarty;
$smarty->left_delimiter="{{";
$smarty->right_delimiter="}}";
$smarty->assign("main","./templates/a.html");
$smarty->display("./templates/xx.html");
?>
为什么这里$smarty->assign("main","./templates/a.html")就不可以,
$smarty->assign("main","templates/a.html");?和$smarty->assign("main","a.html");?都可以呢,目录结构是
xx.html
{{include file=$main}}
23
a.html内容
bb
?以下是目录结构
------解决方案--------------------
smarty 模板?
相关文章
相关视频
上一篇: crontab无法执行php的解决方法,crontabphp
下一篇: PHP单元测试phpunit