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