Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 获取模板名称-Smarty_Php_Templates_Smarty - Fatal编程技术网

Php 获取模板名称-Smarty

Php 获取模板名称-Smarty,php,templates,smarty,Php,Templates,Smarty,我正在处理的网站是一个混乱,需要找出模板文件,smarty是渲染 smarty template对象上是否有我可以调用以获取当前模板文件的方法 比如说 echo $tplObj->getTemplate(); // echos "shop/templates/cart.tpl" 也许标签及其相关联的信息可以帮助您,这里?也许标签及其相关联的信息可以帮助您,这里?来自文档: {$smarty.template} 返回正在处理的当前模板的名称。以下示例显示了container.tpl和包含

我正在处理的网站是一个混乱,需要找出模板文件,smarty是渲染

smarty template对象上是否有我可以调用以获取当前模板文件的方法

比如说

echo $tplObj->getTemplate(); // echos "shop/templates/cart.tpl"
也许标签及其相关联的信息可以帮助您,这里?

也许标签及其相关联的信息可以帮助您,这里?

来自文档:

{$smarty.template}
返回正在处理的当前模板的名称。以下示例显示了container.tpl和包含的banner.tpl,其中包含{$smarty.template}

<b>Main container is {$smarty.template}</b>
{include file='banner.tpl'}
主容器是{$smarty.template}
{include file='banner.tpl'}
将输出

<b>Main page is container.tpl</b>
banner.tpl
主页面是container.tpl
banner.tpl
来自文档:

{$smarty.template}
返回正在处理的当前模板的名称。以下示例显示了container.tpl和包含的banner.tpl,其中包含{$smarty.template}

<b>Main container is {$smarty.template}</b>
{include file='banner.tpl'}
主容器是{$smarty.template}
{include file='banner.tpl'}
将输出

<b>Main page is container.tpl</b>
banner.tpl
主页面是container.tpl
banner.tpl