ifdef tag is also available in the foreach tag.
$assign['sample_foreach11']['a1'] = 'foo';
$assign['sample_foreach11']['a2'] = 'dummy';
$assign['sample_foreach11']['a3'] = 'bar';
unset($assign['sample_foreach11']['a2']); // check for ifdef
{{ @foreach sample_foreach11 }}
{{ @ifdef @key }}
defined : {{ @val }}
{{ @elsedef }}
undefined
{{ @endifdef }}
<br>
{{ @endforeach }}
defined : foo
defined : bar