We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
|
when
1 parent 6a440dd commit 028c27bCopy full SHA for 028c27b
book/src/template_syntax.md
@@ -610,6 +610,15 @@ if not all possible values need an individual handling.
610
Because a `{% match %}` block could not generate valid code otherwise,
611
you have to provide at least one `{% when %}` case and/or an `{% else %}` case.
612
613
+You can also match against multiple alternative patterns at once:
614
+
615
+```jinja
616
+{% match number %}
617
+ {% when 1 | 4 | 86 %} Some numbers
618
+ {% when n %} Number is {{ n }}
619
+{% endmatch %}
620
+```
621
622
### Referencing and dereferencing variables
623
624
If you need to put something behind a reference or to dereference it, you
0 commit comments