From e134e54820689b2f56b6df342aa11bcac60243d6 Mon Sep 17 00:00:00 2001 From: "uwe.tews@googlemail.com" Date: Sun, 19 Feb 2012 18:53:10 +0000 Subject: [PATCH] - enhancement added Smarty special variable $smarty.template_object to return the current template object (Forum Topic 20289) --- change_log.txt | 2 ++ .../smarty_internal_compile_private_special_variable.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/change_log.txt b/change_log.txt index 1824fc48..f37c2bb5 100644 --- a/change_log.txt +++ b/change_log.txt @@ -2,6 +2,8 @@ 19.02.2012 - bugfix {include} could result in a fatal error if used in appended or prepended nested {block} tags (reported by mh and Issue 83) +- enhancement added Smarty special variable $smarty.template_object to return the current template object (Forum Topic 20289) + 07.02.2012 - bugfix increase entropy of internal function names in compiled and cached template files (Forum Topic 20996) diff --git a/libs/sysplugins/smarty_internal_compile_private_special_variable.php b/libs/sysplugins/smarty_internal_compile_private_special_variable.php index f9adcec8..4760dbe3 100644 --- a/libs/sysplugins/smarty_internal_compile_private_special_variable.php +++ b/libs/sysplugins/smarty_internal_compile_private_special_variable.php @@ -62,6 +62,9 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C case 'template': return 'basename($_smarty_tpl->source->filepath)'; + case 'template_object': + return '$_smarty_tpl'; + case 'current_dir': return 'dirname($_smarty_tpl->source->filepath)';