views:

205

answers:

3

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"
+1  A: 

Have you tried to include the debug console?

idea
+1  A: 

Maybe the {debug} tag and its associated Debugging console could help, here ?

Pascal MARTIN
+2  A: 

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
RC