Twig
Twig copied to clipboard
Feature request: make filter argument optional
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.