Like this
{{foreach from=$list item='it' key='i'}}
{{$i}},{{$it}}
{{endforeach}}
After Lex,the tokens will like that:foreachTag,newLineText,print $i,print $it,newLineText,endforeachTag.
So the output(with list=[1,3]) should be:
newLine
0,1
newLine
1,3
newLine
That may not be expected.
Like this
After Lex,the tokens will like that:
foreachTag,newLineText,print $i,print $it,newLineText,endforeachTag.So the output(with list=[1,3]) should be:
newLine0,1
newLine1,3
newLineThat may not be expected.