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

afficher le [i]i[/i] de la boucle <{foreach

 
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: French
View previous topic :: View next topic  
Author Message
Tuf
Smarty n00b


Joined: 05 Oct 2007
Posts: 2

PostPosted: Fri Oct 05, 2007 4:53 pm    Post subject: afficher le [i]i[/i] de la boucle <{foreach Reply with quote

Bonjour,

J'aimerais afficher le i de la boucle <{foreach item=site from=$sites}>.
Pour afficher un grand 1 en haut de la liste pour le 1er site de chaque catégorie ou de chaque classement de tag.

j'ai essayé d'ajouter des

Code:
<{$smarty.foreach.index}>

Code:
<{$sites.index}>

Code:
<{site}>


Mais sans succes. Pouvez vous me donner une piste ?
Back to top
View user's profile Send private message
Vynka
Smarty Rookie


Joined: 30 Apr 2003
Posts: 17
Location: Belgium

PostPosted: Mon Dec 24, 2007 2:56 pm    Post subject: Reply with quote

Salut,

Vas faire un tour sur : http://smarty.php.net/manual/en/language.function.foreach.php, tu trouveras ce qu'il te faut. A savoir :

Code:
{foreach from=$sites item="site" name="listesites"}
    {$smarty.foreach.listesites.iteration} : {$site}
{/foreach}

[/code]
_________________
Au pays des Gloups!
http://www.wishlist.lu
Back to top
View user's profile Send private message Visit poster's website
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: French 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