• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How to break from <xen:foreach>


Well-known member
There's no break, but you can iterate for a specific count like this:
<xen:foreach loop="$array" key="$key" value="$value" i="$i">
<xen:if is="{$i} <= 10">
TIL <xen:foreach> supports "i"!!!! I have to fix my array_values calls now. Thanks Kier!


Well-known member
You're a good software developer, if you did can program without using break. ;) (Except in switch/case!)