php页面中的
你好,我的网站上有这样的结构:
templates
.orderpages
..domain.tpl
.nextgen_clean
..root.tpl
在root.tpl文件中,我想包括domain.tpl,只有我的$template_dir始终是你所在的文件夹,所以我如何返回文件夹,因为{include-file="../etc}不起作用。
我希望有人能帮忙。
定义如下
$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}