Twig Components / Methods / foreach
foreach
is a Twig tag to create loops with the same syntax as in PHP.
Internally it behaves the exact same way as for: it actually creates ForNode elements, so you have the same functionality like in for loops, including the loop variable and else. else works the same as with for:
Source: Squirrelphp
Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.