[RSS Feed/News] Implement break for foreach in templates

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
I did a search and didn't find anything about this, so here we are...

It would be nice to be able to break out of a foreach loop in templates.

Consider this oversimplified example where $loopArray might have 100 entries...
Code:

Code:
<xf:foreach loop="$loopArray" value="$loopValue">
    <xf:if is="$loopValue.value == 1">
        ...Some code...
    </xf:if>
</xf:foreach>
In the above, the first item is the one that would be processed, but the foreach loop continues through all 100 entries...

Read more
Read more about this Feed . . .
 
Status
Not open for further replies.
Back
Top Bottom