|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
webbies Smarty n00b
Joined: 05 Oct 2004 Posts: 2
|
Posted: Tue Oct 05, 2004 7:30 pm Post subject: for Schleife im Template? |
|
|
Hi,
gibt es eine Möglichkeit mit Smarty eine for Schleife zu bauen? Oder muß ich dafür den PHP Tag nutzen? Also ich möchte etwas wie dieses erreichen:
for ($i=0; $i <= $items; $i++)
Wäre super, wenn mir da jemand helfen könnte.
Viele Grüße
webbies |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Oct 05, 2004 8:30 pm Post subject: |
|
|
Code: | {section name=i loop=$items}
{$smarty.section.i.index}
{/section} |
{section} nimmt die anzahl der elemente, wenn loop ein array ist.
wenn loop allerdings eine ganzzahl ist, wird loop direkt genommen um die anzahl der iterationen zu bestimmen.
HTH |
|
Back to top |
|
webbies Smarty n00b
Joined: 05 Oct 2004 Posts: 2
|
Posted: Wed Oct 06, 2004 7:35 am Post subject: |
|
|
Hi messju,
vielen dank für den Hinweis ... ich kannte loop nur für Arrays. Aber es geht wunderbar
Viele Grüße
webbies |
|
Back to top |
|
ZakMc Smarty Pro
Joined: 04 Oct 2004 Posts: 182
|
|
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
|