aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_shared_inheritance.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_shared_inheritance.php')
-rw-r--r--vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_shared_inheritance.php26
1 files changed, 14 insertions, 12 deletions
diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_shared_inheritance.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_shared_inheritance.php
index c95576596..a32173cd6 100644
--- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_shared_inheritance.php
+++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_shared_inheritance.php
@@ -17,30 +17,32 @@
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)
+ 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