Twig - How to loop particular number of times -
I need to generate the link some time (stored in int variables). Is there a way to do this? Toggle to loop? {%} Some data {% endfor%}
for the above example
Edit: I also tried:
{% set k = 10%} {% i in 0 ..k %} {% I} {I}} {% endfor%} but it generates an exception:
com.lyncode.jtwig Exception.ParseException: Incorrect binary operation syntax explanation: input status (line 15, paus 27): {% for i in .... k%} ^
I found an example of work:
{% set k = 10%} {% i in category (1, k) %} {{I}} {% Endfor%} Source: (Was To find and not very comfortable).
Comments
Post a Comment