diff --git a/library/smarty/libs/sysplugins/smarty_internal_compile_private_function_plugin.php b/library/smarty/libs/sysplugins/smarty_internal_compile_private_function_plugin.php new file mode 100644 --- /dev/null +++ b/library/smarty/libs/sysplugins/smarty_internal_compile_private_function_plugin.php @@ -0,0 +1,69 @@ +has_output = true; + + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + if ($_attr['nocache'] === true) { + $compiler->tag_nocache = true; + } + unset($_attr['nocache']); + // convert attributes into parameter array string + $_paramsArray = array(); + foreach ($_attr as $_key => $_value) { + if (is_int($_key)) { + $_paramsArray[] = "$_key=>$_value"; + } else { + $_paramsArray[] = "'$_key'=>$_value"; + } + } + $_params = 'array(' . implode(",", $_paramsArray) . ')'; + // compile code + $output = "\n"; + + return $output; + } +}