开发者

Get Template Name - Smarty

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 ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜