bool Twig Filter

The bool filter converts a boolean-like value to a true or false value.

A boolean-like value can be:

  • true
  • false
  • yes
  • no
  • 1
  • 0
This filter is unique to Aptuitiv. It is not part of the core Twig functionality.
{{ variable|bool }}

// Or, in some logic:

{% if myVariable|bool == true %}
{% endif %}
This documentation is only for Aptuitiv CMS. Learn more.
Get Started With Aptuitiv