Possible bug in smarty_function_assign
| From: | Martin Kjeldsen | Date: | Wed, 03 Apr 2002 19:20:04 +0000 |
| Subject: | Possible bug in smarty_function_assign | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-3465@lists.php.net to get a copy of this message | ||
Hi,
I have been having problems with the smarty_function_assign function. E.g.
this code snippet:
{foreach from=$result_arr item=item name=result_arr_for}
<tr>
{foreach from=$item item=field_val key=key}
{if $key != 'id'}
<td>{$field_val|default:" "}</td>
{else}
{assign var="id" value="$field_val"}
{/if}
{/foreach}
<td style="padding-right:10px;" align="center">
<input type="submit" name="modify[{$id}]" value="Modify" />
</td>
<td style="padding-right:10px;" align="center">
<input type="submit" name="delete[{$id}]" value="Delete" />
</td>
</tr>
{/foreach}
doesn't work the first time. It prints out modify[] and next it prints the
first variable position 0. If I use {assign var="id" value="$field_val"}
twice it works, but that can't be the solution.
Martin