diff options
Diffstat (limited to 'vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_for.php')
-rw-r--r-- | vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_for.php | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_for.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_for.php index 79848e521..3f113e56d 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_for.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_for.php @@ -26,15 +26,15 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase * The parser is generating different sets of attribute by which this compiler can * determine which syntax is used. * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * * @return string compiled code */ public function compile($args, $compiler, $parameter) { - $compiler->loopNesting ++; + $compiler->loopNesting++; if ($parameter === 0) { $this->required_attributes = array('start', 'to'); $this->optional_attributes = array('max', 'step'); @@ -45,7 +45,6 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase $this->mapCache = array(); // check and get attributes $_attr = $this->getAttributes($compiler, $args); - $output = "<?php\n"; if ($parameter === 1) { foreach ($_attr[ 'start' ] as $_statement) { @@ -93,7 +92,6 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase $output .= "\$_smarty_tpl->tpl_vars[$var]->last = \$_smarty_tpl->tpl_vars[$var]->iteration === \$_smarty_tpl->tpl_vars[$var]->total;"; } $output .= '?>'; - $this->openTag($compiler, 'for', array('for', $compiler->nocache)); // maybe nocache because of nocache variables $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; @@ -113,9 +111,9 @@ class Smarty_Internal_Compile_Forelse extends Smarty_Internal_CompileBase /** * Compiles code for the {forelse} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * * @return string compiled code */ @@ -123,10 +121,8 @@ class Smarty_Internal_Compile_Forelse extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->getAttributes($compiler, $args); - list($openTag, $nocache) = $this->closeTag($compiler, array('for')); $this->openTag($compiler, 'forelse', array('forelse', $nocache)); - return "<?php }} else { ?>"; } } @@ -142,24 +138,22 @@ class Smarty_Internal_Compile_Forclose extends Smarty_Internal_CompileBase /** * Compiles code for the {/for} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * * @return string compiled code */ public function compile($args, $compiler, $parameter) { - $compiler->loopNesting --; + $compiler->loopNesting--; // check and get attributes $_attr = $this->getAttributes($compiler, $args); // must endblock be nocache? if ($compiler->nocache) { $compiler->tag_nocache = true; } - list($openTag, $compiler->nocache) = $this->closeTag($compiler, array('for', 'forelse')); - $output = "<?php }\n"; if ($openTag !== 'forelse') { $output .= "}\n"; |