From 7085a0c2f7104a56a7e946c43ba0b5736be5f4e7 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 27 Dec 2016 14:47:01 +0100 Subject: * smarty bundled --- .../smarty_internal_compile_shared_inheritance.php | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php (limited to 'lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php') diff --git a/lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php b/lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php new file mode 100644 index 0000000..c955765 --- /dev/null +++ b/lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php @@ -0,0 +1,46 @@ +_cache[ 'inheritanceInit' ])) { + $compiler->registerPostCompileCallback(array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'), + array($initChildSequence), 'inheritanceInit', $initChildSequence); + + $compiler->_cache[ 'inheritanceInit' ] = true; + } + } + + /** + * Compile inheritance initialization code as prefix + * + * @param \Smarty_Internal_TemplateCompilerBase $compiler + * @param bool|false $initChildSequence if true force child template + */ + static function postCompile(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false) + { + $compiler->prefixCompiledCode .= "_loadInheritance();\n\$_smarty_tpl->inheritance->init(\$_smarty_tpl, " . + var_export($initChildSequence, true) . ");\n?>\n"; + } +} \ No newline at end of file -- cgit v1.2.3