fix compiling problem with {foreach} tags

This commit is contained in:
mohrt
2003-01-24 16:08:31 +00:00
parent d6766ec11e
commit 6e0c6ce6f3
2 changed files with 4 additions and 4 deletions

View File

@@ -977,13 +977,13 @@ class Smarty_Compiler extends Smarty {
$output .= "{$foreach_props}['show'] = {$foreach_props}['total'] > 0;\n";
$output .= "if ({$foreach_props}['show']):\n";
$output .= "{$foreach_props}['iteration'] = 0;\n";
$output .= " foreach ((array)$from as $key_part$item):\n";
$output .= " foreach ((array)$from as $key_part\$this->_tpl_vars['$item']):\n";
$output .= " {$foreach_props}['iteration']++;\n";
$output .= " {$foreach_props}['first'] = ({$foreach_props}['iteration'] == 1);\n";
$output .= " {$foreach_props}['last'] = ({$foreach_props}['iteration'] == {$foreach_props}['total']);\n";
} else {
$output .= "if (count((array)$from)):\n";
$output .= " foreach ((array)$from as $key_part$item):\n";
$output .= " foreach ((array)$from as $key_part\$this->_tpl_vars['$item']):\n";
}
$output .= '?>';

View File

@@ -977,13 +977,13 @@ class Smarty_Compiler extends Smarty {
$output .= "{$foreach_props}['show'] = {$foreach_props}['total'] > 0;\n";
$output .= "if ({$foreach_props}['show']):\n";
$output .= "{$foreach_props}['iteration'] = 0;\n";
$output .= " foreach ((array)$from as $key_part$item):\n";
$output .= " foreach ((array)$from as $key_part\$this->_tpl_vars['$item']):\n";
$output .= " {$foreach_props}['iteration']++;\n";
$output .= " {$foreach_props}['first'] = ({$foreach_props}['iteration'] == 1);\n";
$output .= " {$foreach_props}['last'] = ({$foreach_props}['iteration'] == {$foreach_props}['total']);\n";
} else {
$output .= "if (count((array)$from)):\n";
$output .= " foreach ((array)$from as $key_part$item):\n";
$output .= " foreach ((array)$from as $key_part\$this->_tpl_vars['$item']):\n";
}
$output .= '?>';