Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

for Schleife im Template?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
webbies
Smarty n00b


Joined: 05 Oct 2004
Posts: 2

PostPosted: Tue Oct 05, 2004 7:30 pm    Post subject: for Schleife im Template? Reply with quote

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
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Tue Oct 05, 2004 8:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
webbies
Smarty n00b


Joined: 05 Oct 2004
Posts: 2

PostPosted: Wed Oct 06, 2004 7:35 am    Post subject: Reply with quote

Hi messju,

vielen dank für den Hinweis ... ich kannte loop nur für Arrays. Aber es geht wunderbar Smile

Viele Grüße

webbies
Back to top
View user's profile Send private message
ZakMc
Smarty Pro


Joined: 04 Oct 2004
Posts: 182

PostPosted: Thu Oct 07, 2004 10:47 am    Post subject: Reply with quote

Hier ist noch der Link fürs FAQ, wo das beschrieben steht

http://smarty.incutio.com/?page=SmartyFrequentlyAskedQuestions#template-9
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP