diff options
author | emkael <emkael@tlen.pl> | 2018-10-18 02:40:38 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2018-10-18 02:40:38 +0200 |
commit | eab8a101e7a3fcbb41e01a574985e06c5a3775de (patch) | |
tree | 60f201da5984b0c3638d10da02bba42b61aa3177 /lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php | |
parent | 7f38be342c1495aeca418286c15c25c18ac9e142 (diff) |
Updating Smarty
Diffstat (limited to 'lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php')
-rw-r--r-- | lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php | 29 |
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 +} |