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

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

    Details

    • Type: Improvement
    • Status: Unverified Fix (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-RC4
    • Fix Version/s: 3.2.0-a1
    • Component/s: Template Engine
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: