SV: [SMARTY] $smarty.post.myArray[index] in cvs
| From: | Paolo Nesti Poggi | Date: | Fri, 21 Mar 2003 10:09:47 +0000 |
| Subject: | SV: [SMARTY] $smarty.post.myArray[index] in cvs | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8799@lists.php.net to get a copy of this message | ||
Hi Monte or Messju
I did'nt get any answer when I posted this last.
However it's real issue to me, so here I try again, and a bit more correctly
;).
smarty (up to 2.4.2. I believe) allowed to loop through a $_POST array with
a section like:
{section name=index loop=$smarty.post.posted_vars}
{$smarty.post.posted_vars[index]}
{/section}
posted_vars are posted by means of:
<input type ="hidden" name="posted_vars[]" value="value1">
<input type ="hidden" name="posted_vars[]" value="value2">
and so on
With smarty 2.5.0 RC1 I get an error:
syntax error: $smarty.post.posted_vars is an invalid reference
(Smarty_Compiler.class.php, line 1681) in
c:\php\pear\Smarty\Smarty_Compiler.class.php on line 1812
This happens because the '[' bracket of "posted_vars[index" gets caught as
being !='.' in line 1681
Is it meant to be so, and if it is, how can I work around this.
Obviously I happen to do something very wrong, as this seems to me to be a
very basic use of Smarty.
Regards
Paolo