|
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 |
kid Smarty Rookie
Joined: 04 Jul 2004 Posts: 13
|
Posted: Thu Aug 19, 2004 5:20 pm Post subject: Schleife ohne Array |
|
|
Hallo,
geht und wenn wie in Smarty ne Schleife ohne Array
cycle, foreach und section könnens nicht, oder?
Viele Grüße,
Alexander |
|
Back to top |
|
coach Smarty Regular
Joined: 03 Jun 2004 Posts: 65
|
Posted: Thu Aug 19, 2004 6:24 pm Post subject: |
|
|
Mir fällt jetzt
Code: |
{php}
for () {
{/php}
{php}
}
{/php}
|
ein. Müßte wohl klappen. Oder irgendwie per xrange ein Array erzeugen und darüber dann mit section etc. arbeiten. Den xrange kannst auf alle Fälle im {php}{/php} machen und dann dem $this->.. zuweisen. Ob es per {assign } geht mußt du testen.
Coach |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Aug 19, 2004 7:53 pm Post subject: |
|
|
{section} ist eigentlich eine for-schleife.
{section name=i loop=10}
{$smarty.section.i.index}
{/section}
liefert: 0 1 2 3 4 5 6 7 8 9 |
|
Back to top |
|
kid Smarty Rookie
Joined: 04 Jul 2004 Posts: 13
|
Posted: Thu Aug 19, 2004 9:12 pm Post subject: |
|
|
vielen Dank! Das funzt. Schade, dass das nicht in der Doku als Beispiel drin ist. |
|
Back to top |
|
pxlArtizzt Smarty Rookie
Joined: 09 Aug 2004 Posts: 13
|
Posted: Wed Aug 25, 2004 7:46 am Post subject: |
|
|
genau, sowas gehört echt in die Dokumentation!!! |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
|
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
|