Pro tips

  • Make the if statement shorter!
{{ expense.tags.code ? 'yes' : 'no' }}

{{ expense.tags.code ? 'yes' }} is the same as
{{ expense.tags.code ? 'yes' : '' }}

// Output the expense.tag.code if it exists - output 'no' otherwise.
{{ expense.tags.code ?? 'no' }}
  • Use Regular Expressions
// Checking if it's a valid email address:
{% if report.account.email matches '/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/' %}{% endif %}
Did this answer your question?