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 {number for iFLoops%} {{i}} do not work . I googled it but did not get the actual solution

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

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -