feulf / raintpl3

The easiest Template Engine for PHP
https://feulf.github.io/raintpl
258 stars 57 forks source link

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

Open kargnas opened 11 years ago

kargnas commented 11 years ago

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.

keskad commented 11 years ago

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

feulf commented 11 years ago

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!