RE: [SMARTY] foreach/assign conflict? dropping last value
| From: | Josh Johnson | Date: | Tue, 15 Oct 2002 12:02:33 +0000 |
| Subject: | RE: [SMARTY] foreach/assign conflict? dropping last value | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6140@lists.php.net to get a copy of this message | ||
A few questions:
Why aren't you using $smarty.post?
When are you trying to access that assigned variable? (the order_$key
one)? Inside of the foreach loop, or outside?
-- Josh
-----Original Message-----
From: guido [mailto:sguido@rogers.com]
Sent: Tuesday, October 15, 2002 12:03 AM
To: Smarty
Cc: Martin Kjeldsen
Subject: [SMARTY] foreach/assign conflict? dropping last value
ok this is a weird one ...
what I'm doing is taking a HTTP_POST_VARS and looping through them,
setting them as hidden form fields and then setting them as variables:
{foreach key=key item=item from=$post_vars}
{assign var="order_$key" value="$item"}
<input type="hidden" name="{$key}" value="{$item}"> {* FORM *}
{/foreach}
Now here's the weird part .. all of the input/hidden fields show up,
but not the assigned variables. The last one drops off and isn't
available.
if I add in another:
{assign var="order_$key" value="$item"}
after the input, it works.
Martin Kjeldsen seem to have a similar problem:
http://marc.theaimsgroup.com/?l=smarty-general&m=101786148311641&w=2
but there was no resolution there...
any ideas?
--
Best regards,
guido mailto:sguido@rogers.com
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php