Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
|
front:twig:instruction:les_boucles [2019/12/08 07:41] 127.0.0.1 modification externe |
front:twig:instruction:les_boucles [2020/04/09 10:20] (Version actuelle) admin |
||
|---|---|---|---|
| Ligne 40: | Ligne 40: | ||
| </ | </ | ||
| 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 : | ||
| + | < | ||
| + | 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 | ||
| + | </ | ||
| === Liens === | === Liens === | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||