Making variables accessible to the template in a block function
| From: | David Heinemeier Hansson | Date: | Fri, 21 Feb 2003 11:41:48 +0000 |
| Subject: | Making variables accessible to the template in a block function | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-795@lists.php.net to get a copy of this message | ||
I'd like this:
{repeat times=3 counter=time}
echo {$time}
{/repeat}
to do this:
1
2
3
...but I can't seem to make the $time available in the repeated block on each iteration. I just get this:
3
3
3
As if the loop is done before parsing or something. Is this a Smarty limitation or am I just missing something?
--
David Heinemeier Hansson
http://www.loudthinking.com/ -- Broadcasting Brain