nrueckmann / smarty-php

Automatically exported from code.google.com/p/smarty-php
0 stars 0 forks source link

Foreachelse in nested foreach failed #216

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

{foreach name='uuu' from=array(1) item=item}
{$ticket}
{foreach from=array() item=item}
{/foreach}
{foreachelse}
*
{/foreach}

What is the expected output? What do you see instead?
> Expected: 1
> See: 1*

What version of the product are you using? On what operating system?
> 3.1.16 on Linux LMDE

Please provide any additional information below.
> Occures only if inner cycle using same iterating variable as outer cycle.

Original issue reported on code.google.com by ja.lo...@gmail.com on 5 Dec 2014 at 1:48

GoogleCodeExporter commented 8 years ago
Smarty template variables have no local scope within loops, So if you have a 
nested {foreach} use different names for item and key.

This may change some time in future.

Original comment by Uwe.Tews@googlemail.com on 13 May 2015 at 6:06