Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.31 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Reference array from key in for loop with Twig
  2. for($i =0; $i <= $limit; $i++) {
  3.     if($data[$i]) {
  4.         echo $data[$i];
  5.     }
  6. )
  7.        
  8. {% for i in range(0, limit-1) %}
  9.     {{ data.i }}
  10. {% endfor %}
  11.        
  12. {% for i in range(0, limit-1) %}
  13.   {% if data[i] is defined %}
  14.     {{ data[i] }}
  15.   {% endif %}
  16. {% endfor %}