case

Description

When evaluating a large number of conditions.

Syntax

{% case <condition> %}
{% when <value_1> %}
  <code>
...
{% when <value_x> %}
  <code>
{% else %}
  <code>
{% endcase %}

Example

{% case condition %}
{% when 1 %}
  hit 1
{% when 2 %}
  hit 2
{% else %}
  hit else
{% endcase %}
© 2024 LocomotiveCMS Terms of use Privacy Policy
Back to top