0

TWIG code

{% if 'export' in url %}
<a href="{{ url }}"{{ attributes.addClass('btn btn-success') }}>
{{ '@format export'|t({'@format': 'Export files'},{'context': 
'kjus'}) }}

</a>
{% else %}
<a href="{{ url }}"{{ attributes.addClass('btn btn-success') }}>
{{ '@format csv'|t({'@format': 'CSV'},{'context': 'kjus'}) }}

</a>
{% endif %}

shows the following error

Twig\Error\SyntaxError: Unexpected token "punctuation" of value "(" ("end of print statement" expected). in Twig\TokenStream->expect() Not getting the error

3
  • Doesn't the error also mention the line? Commented Apr 18, 2024 at 14:07
  • It does mention from here {{ '@format export'|t({'@format': 'Export invoices'},{'context': 'kline'}) }} Though there was a missing ',' after the translatio filter but didnot work Commented Apr 18, 2024 at 14:08
  • The snippet looks syntactically correct. Did you try and clear the cache after the upgrade? Commented Apr 18, 2024 at 14:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.