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

Les deux révisions précédentes Révision précédente
front:twig:instruction:les_boucles [2020/04/09 12:20]
admin
front:twig:instruction:les_boucles [2020/04/09 12:20] (Version actuelle)
admin
Ligne 43: Ligne 43:
 **Astuces** **Astuces**
 Variable de boucle disponible pour la boucle for : Variable de boucle disponible pour la boucle for :
 +<code>
 loop.index The current iteration of the loop. (1 indexed) loop.index The current iteration of the loop. (1 indexed)
 loop.index0 The current iteration of the loop. (0 indexed) loop.index0 The current iteration of the loop. (0 indexed)
Ligne 51: Ligne 52:
 loop.length The number of items in the sequence loop.length The number of items in the sequence
 loop.parent The parent context 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.1586427615.txt.gz · Dernière modification: 2020/04/09 12:20 de admin