Increment value in twig file -


I have a loop with a .twig file that outputs elements.

I have to increase a value with each element. I know how to do this in PHP, but it does not explain how to do it with a twig document. Any suggestions I really can not do in the controller? {/ MyVal = myVal + 10}} {% endfor%}

use it :

  {% set myVal = 50%} {% for item in item}%} {% MyVal = myVal + 10%} {% endfor%}   

, you set {%%} to set prices, set blocks / forms, etc. For output, {{}} is

Comments

Popular posts from this blog

php - how to change mysql_result($res, 0, "url"); to mysqli -

c# - How to clone a HttpRequestMessage when the original request has Content? -

split - php explode string with Uppercase if lowercase letter exists before it without space -