I'm dealing with website is a mess and need to find out the template file that smarty is rendering.
Is there开发者_运维问答 a method on the smarty template object that I can call to get the current template file?
for example
echo $tplObj->getTemplate(); // echos "shop/templates/cart.tpl"
From the doc:
{$smarty.template}
Returns the name of the current template being processed. The following example shows the container.tpl and the included banner.tpl with {$smarty.template} within both.
<b>Main container is {$smarty.template}</b>
{include file='banner.tpl'}
will output
<b>Main page is container.tpl</b>
banner.tpl
Maybe the {debug}
tag and its associated Debugging console could help, here ?
精彩评论