summaryrefslogtreecommitdiff
path: root/lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php')
-rw-r--r--lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php29
1 files changed, 16 insertions, 13 deletions
diff --git a/lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php b/lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php
index c955765..d90262e 100644
--- a/lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php
+++ b/lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php
@@ -17,30 +17,33 @@
class Smarty_Internal_Compile_Shared_Inheritance extends Smarty_Internal_CompileBase
{
/**
- * Register post compile callback to compile inheritance initialization code
+ * Compile inheritance initialization code as prefix
*
* @param \Smarty_Internal_TemplateCompilerBase $compiler
* @param bool|false $initChildSequence if true force child template
*/
- public function registerInit(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)
+ public static function postCompile(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)
{
- if ($initChildSequence || !isset($compiler->_cache[ 'inheritanceInit' ])) {
- $compiler->registerPostCompileCallback(array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'),
- array($initChildSequence), 'inheritanceInit', $initChildSequence);
-
- $compiler->_cache[ 'inheritanceInit' ] = true;
- }
+ $compiler->prefixCompiledCode .= "<?php \$_smarty_tpl->_loadInheritance();\n\$_smarty_tpl->inheritance->init(\$_smarty_tpl, " .
+ var_export($initChildSequence, true) . ");\n?>\n";
}
/**
- * Compile inheritance initialization code as prefix
+ * Register post compile callback to compile inheritance initialization code
*
* @param \Smarty_Internal_TemplateCompilerBase $compiler
* @param bool|false $initChildSequence if true force child template
*/
- static function postCompile(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)
+ public function registerInit(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)
{
- $compiler->prefixCompiledCode .= "<?php \$_smarty_tpl->_loadInheritance();\n\$_smarty_tpl->inheritance->init(\$_smarty_tpl, " .
- var_export($initChildSequence, true) . ");\n?>\n";
+ if ($initChildSequence || !isset($compiler->_cache[ 'inheritanceInit' ])) {
+ $compiler->registerPostCompileCallback(
+ array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'),
+ array($initChildSequence),
+ 'inheritanceInit',
+ $initChildSequence
+ );
+ $compiler->_cache[ 'inheritanceInit' ] = true;
+ }
}
-} \ No newline at end of file
+}