Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-13132

Twig: move the loops content from loops. to the root context

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 3.2.0-a1
    • 3.1.0-RC4
    • Template Engine
    • None

      Currently the content of the BEGIN blocks are stored under a loops. sub context. So if we want to use a twig for in a template we need to either not call assign_block_vars at all or iterate over loops.var_name.

      Instead we should move the content to the root context (like all the other variables) and then rename the inner variable:

      {% for __inner.my_loop in my_loop%}{endfor} or 
      {% for my_loop.__inner in my_loop%}{endfor}
       
      instead of 
      {% for my_loop in loops.my_loop%}{endfor}
      

            nicofuma nicofuma
            nicofuma nicofuma
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: