Open godismyjudge95 opened 9 months ago
Probably isn't helpful one bit but here is how Laravel Blade does it - https://github.com/laravel/framework/blob/10.x/src/Illuminate/View/Compilers/Concerns/CompilesLoops.php#L126-L152
This would be super useful. Some prior art: in Latte templates these are called continueIf
and breakIf
:
{foreach $rows as $row}
{continueIf $row->date < $now}
{breakIf $row->parent === null}
...
{/foreach}
Would be awesome if Antlers supported the continue and break control structures: https://www.php.net/manual/en/control-structures.break.php https://www.php.net/manual/en/control-structures.continue.php
Currently if you have a loop and you want to skip an item:
But if we had continue support (I think this would work? Not sure about the ?= syntax):
Or another scenario where this would be cleaner: