php-liquid
php-liquid copied to clipboard
Support default allow_false=true
Hello 👋
Any thought to support the allow_false
feature to the default filter?
https://shopify.github.io/liquid/filters/default/#allowing-false
{% assign display_price = false %}
{{ display_price | default: true, allow_false: true }}
Test Case: https://github.com/Shopify/liquid/blob/c99c93255d55129652e262e87c27d359628f71e6/test/integration/standard_filter_test.rb#L782-L792
I'm down to review a PR that add this feature.
For now, I worked around it with a if-condition.
{% assign display_price = false %}
{%- if display_price == false %}
false
{%- else %}
true
{%- endif %}