Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-13132

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

    XMLWordPrintable

Details

    • Improvement
    • Status: Unverified Fix (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 3.1.0-RC4
    • 3.2.0-a1
    • Template Engine
    • None

    Description

      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}
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: