 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
TimJim Smarty Rookie

Joined: 22 Apr 2003 Posts: 14 Location: Germany
|
Posted: Fri Apr 25, 2003 1:41 pm Post subject: sections: print number of loop? |
|
|
Hi is it possibly to print the number of the loop within the section without having an array like $arr = array("1", "2", "3", "4")
Like this but with internal variables/functions only:
$arr = array("1", "2", "3", "4");
$smarty->assign("number", $arr);
{section name="test" loop=$number}
loop: {$number[test]}<br>
{/section} |
|
| Back to top |
|
messju Administrator

Joined: 16 Apr 2003 Posts: 3335 Location: Oldenburg, Germany
|
|
| Back to top |
|
TimJim Smarty Rookie

Joined: 22 Apr 2003 Posts: 14 Location: Germany
|
Posted: Fri Apr 25, 2003 4:27 pm Post subject: |
|
|
Thx, I looked up in the manual, but didn't came to this point. Next time I will study the manual more carefully.
Btw: I already have started loving Smarty. This template engine is awesome and a big help for me. Thank you guys for doing such a great work. |
|
| Back to top |
|
Wom.bat Smarty Pro

Joined: 24 Apr 2003 Posts: 107 Location: Munich, Germany
|
Posted: Fri Apr 25, 2003 6:02 pm Post subject: |
|
|
btw... the same method works for foreach too, but that isn't documented...  _________________ Hello. I am a signature virus. Please copy me to other signatures to help me spread  |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|