mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 09:54:27 +02:00
Fixed bug that wouldn't let you do specify non-array values for 'loop'
attribute.
This commit is contained in:
@@ -568,7 +568,7 @@ class Smarty
|
||||
foreach ($attrs as $attr_name => $attr_value) {
|
||||
switch ($attr_name) {
|
||||
case 'loop':
|
||||
$output .= "{$section_props}['loop'] = count($attr_value);\n";
|
||||
$output .= "{$section_props}['loop'] = is_array($attr_value) ? count($attr_value) : $attr_value;\n";
|
||||
break;
|
||||
|
||||
case 'show':
|
||||
|
@@ -15,7 +15,7 @@ the value of $SCRIPT_NAME is {$SCRIPT_NAME}
|
||||
hello, my name is {$Name|upper}
|
||||
|
||||
My interests are:
|
||||
{section name=outer loop=$FirstName}
|
||||
{section name=outer loop=2}
|
||||
{if %outer.index% is odd by 2}
|
||||
{%outer.rownum%} . {$outer/FirstName} {$outer/LastName}
|
||||
{else}
|
||||
|
@@ -568,7 +568,7 @@ class Smarty
|
||||
foreach ($attrs as $attr_name => $attr_value) {
|
||||
switch ($attr_name) {
|
||||
case 'loop':
|
||||
$output .= "{$section_props}['loop'] = count($attr_value);\n";
|
||||
$output .= "{$section_props}['loop'] = is_array($attr_value) ? count($attr_value) : $attr_value;\n";
|
||||
break;
|
||||
|
||||
case 'show':
|
||||
|
@@ -15,7 +15,7 @@ the value of $SCRIPT_NAME is {$SCRIPT_NAME}
|
||||
hello, my name is {$Name|upper}
|
||||
|
||||
My interests are:
|
||||
{section name=outer loop=$FirstName}
|
||||
{section name=outer loop=2}
|
||||
{if %outer.index% is odd by 2}
|
||||
{%outer.rownum%} . {$outer/FirstName} {$outer/LastName}
|
||||
{else}
|
||||
|
Reference in New Issue
Block a user