[英]How to include tpl file in folder above smarty
您好,我的网站中有以下结构:
templates
.orderpages
..domain.tpl
.nextgen_clean
..root.tpl
在文件root.tpl中,我要包含domain.tpl,只有$ template_dir始终是您的文件夹,所以我不能返回该文件夹,因为{include file =“ ../ etc}不起作用。
我希望有人能帮帮忙。
从PHP页面定义如下
$file_to_show="page_request.tpl";
$smarty->assign("file_to_show", $file_to_show);
现在在tpl文件中显示变量
{include file=$file_to_show}
而且还可以从tpl直接包括如下
{include file=page.tpl}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.