continue/breakタグは、foreachタグの中でPHPのcontinue/break文のような動作をします。
{{ @foreach val_name }}
{{ @if operand operator operand }}
{{ @continue }} | {{ @break }} | statements
{{ @elseif operand operator operand }}
{{ @continue }} | {{ @break }} | statements
{{ @else }}
{{ @continue }} | {{ @break }} | statements
{{ @endif }}
{{ @endforeach }}
$assign['sample_foreach7']['a7'][] = array('id'=>71, 'name'=>'Windows', 'vendor'=>'MicroSoft');
$assign['sample_foreach7']['a7'][] = array('id'=>72, 'name'=>'MacOS', 'vendor'=>'Apple');
$assign['sample_foreach7']['a7'][] = array('id'=>73, 'name'=>'continue', 'vendor'=>'continue');
$assign['sample_foreach7']['a7'][] = array('id'=>74, 'name'=>'break', 'vendor'=>'break');
$assign['sample_foreach7']['a7'][] = array('id'=>75, 'name'=>'none', 'vendor'=>'none');
{{ @foreach sample_foreach7.a7 }}
{{ @if .id == 71 }}
if<br>
-- id={{ .id }}, name={{ .name }}, vendor={{ .vendor }}<br>
{{ @elseif .id == 73 }}
continue<br>
{{ @continue }}<br>
-- id={{ .id }}, name={{ .name }}, vendor={{ .vendor }}<br>
{{ @elseif .id == 74 }}
break<br>
{{ @break }}<br>
-- id={{ .id }}, name={{ .name }}, vendor={{ .vendor }}<br>
{{ @else }}
else<br>
-- id={{ .id }}, name={{ .name }}, vendor={{ .vendor }}<br>
{{ @endif }}
{{ @endforeach }}
if
-- id=71, name=Windows, vendor=MicroSoft
else
-- id=72, name=MacOS, vendor=Apple
continue
break