Outils pour utilisateurs

Outils du site


front:twig:instruction:les_boucles

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
front:twig:instruction:les_boucles [2019/12/08 08:41]
127.0.0.1 modification externe
front:twig:instruction:les_boucles [2020/04/09 12:20] (Version actuelle)
admin
Ligne 40: Ligne 40:
 </code> </code>
 Ce dernier extrait délimite la fin de la boucle for Ce dernier extrait délimite la fin de la boucle for
 +
 +**Astuces**
 +Variable de boucle disponible pour la boucle for :
 +<code>
 +loop.index The current iteration of the loop. (1 indexed)
 +loop.index0 The current iteration of the loop. (0 indexed)
 +loop.revindex The number of iterations from the end of the loop (1 indexed)
 +loop.revindex0 The number of iterations from the end of the loop (0 indexed)
 +loop.first True if first iteration
 +loop.last True if last iteration
 +loop.length The number of items in the sequence
 +loop.parent The parent context
 +</code>
  
 === Liens === === Liens ===
   * [[https://twig.symfony.com/doc/2.x/tags/for.html|La boucle For]]   * [[https://twig.symfony.com/doc/2.x/tags/for.html|La boucle For]]
   * [[https://twig.symfony.com/doc/2.x/tags/do.html|La boucle do]]   * [[https://twig.symfony.com/doc/2.x/tags/do.html|La boucle do]]
front/twig/instruction/les_boucles.1575790873.txt.gz · Dernière modification: 2019/12/08 08:41 de 127.0.0.1