Skip to the content
Documentation

parameters

No ratings yet

These parameters is not explained here or in the section part, so I start some guessing..
[ {break} ] guess this breakes out of the foreach ??
[ {skip} ] and this jumps to next element ?
[ {continue} ] ??

Comments (1 historical)

Written by readers of the earlier documentation sites, kept as they were.

  1. Re: parameters

    Harry Oosterveen ·

    Indeed {break} breaks out of the loop and continues after the it
    Both {skip} and {continue} proceed with the next element, but if a {delimiter} is defined, it will be included after {continue}, but not after {skip}. See this example:
    {let list = array( 1,2,3,4,5)}
    <p>
    {foreach $list as $var}
    {delimiter}<br />{/delimiter}
    {if $var|eq(2)}{skip}{/if}
    {if $var|eq(4)}{continue}{/if}
    {$var}
    {/foreach}
    </p>
    {/let}