Twig icon indicating copy to clipboard operation
Twig copied to clipboard

Feature request: make filter argument optional

Open thsmrtone1 opened this issue 4 years ago • 0 comments

Feature request: Make the argument optional for the filter filter.

Instead of doing this:

{{ ['123 Main St', null, 'New York', 'NY', '10001']|filter(a => a)|join(', ') }}

it would be great if we could just do this:

{{ ['123 Main St', null, 'New York', 'NY', '10001']|filter|join(', ') }}

This would match the behavior of the array_filter() function in PHP.

thsmrtone1 avatar Oct 14 '21 16:10 thsmrtone1