From 49d54c0c3199fb8e380ce68f8fb08a308ddf56a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Eduardo?= Date: Mon, 25 Dec 2017 16:58:41 -0500 Subject: =?UTF-8?q?migraci=C3=B3n=20mayor=20a=20smarty=20PHP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../smarty_internal_compile_shared_inheritance.php | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 smarty/sysplugins/smarty_internal_compile_shared_inheritance.php (limited to 'smarty/sysplugins/smarty_internal_compile_shared_inheritance.php') diff --git a/smarty/sysplugins/smarty_internal_compile_shared_inheritance.php b/smarty/sysplugins/smarty_internal_compile_shared_inheritance.php new file mode 100644 index 0000000..c955765 --- /dev/null +++ b/smarty/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