Re: [PATCH] Error in section propery handling
| From: | Andrei Zmievski | Date: | Mon, 14 May 2001 18:30:31 +0000 |
| Subject: | Re: [PATCH] Error in section propery handling | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-761@lists.php.net to get a copy of this message | ||
On Sun, 13 May 2001, Ludovic LANGE wrote:
> Hello,
>
> I think I've found a difference between the behaviour described in the
> documentation and the way Smarty-1.4.0 handles section properties.
>
> In particular, according to the documentation example 5-26, we can use
> section properties ( <section name>.index_prev for example ) as indexes
> of a variable.
>
> Here is the example from the documentation to illustrate my problems
> (look at the comment 'FYI', and the line just below ):
>
> -------------------------------------------------------------
> Example 5-26. section property index_prev
> {section name=customer loop=$custid}
> {%customer.index%} id: {$custid[customer]}<br>
> {* FYI, $custid[customer.index] and $custid[customer] are identical
> in meaning *}
> {if $custid[customer.index_prev] ne $custid[customer.index]}
> The customer id changed<br>
> {/if}
> {/section}
> -------------------------------------------------------------
>
> But the $custid[customer.index_prev] doesn't get compiled as it should
> by Smarty.
> Instead, it produces the following code :
>
> $this->_tpl_vars['custid']['index_prev']
>
> where in fact it should produce :
>
>
> $this->_tpl_vars['custid'][$_smarty_sections['customer']['properties']['index_prev']]
Have you tried the final 1.4.0 release? It doesn't have this problem.
-Andrei
* Programming is an art form that fights back. *