raintpl3 icon indicating copy to clipboard operation
raintpl3 copied to clipboard

loop bug - Using {$key} on sub template in loop

Open kargnas opened this issue 11 years ago • 2 comments

Parent Template

{loop="$array" as $stats} // temp solution: as $newKey => $stats
    {include="stat"}
{/loop}

Stat Template

{$key} {$stats->hp} {$stats->mp} {$stats->power}

{$key} will print nothing.

kargnas avatar Aug 06 '13 12:08 kargnas

Definitely it's a bug, it may be hard to fix.

keskad avatar Aug 06 '13 13:08 keskad

So I believe also {$counter} and {$value} are not passed inside the included template, right? If we've to pass all the special loop variable inside the loop!

feulf avatar Aug 06 '13 14:08 feulf