Skip to content

Instantly share code, notes, and snippets.

@BenRichter
Last active May 12, 2019 18:28
Show Gist options
  • Save BenRichter/62800f61d1a23b15eb37c31be2531021 to your computer and use it in GitHub Desktop.
Save BenRichter/62800f61d1a23b15eb37c31be2531021 to your computer and use it in GitHub Desktop.
Symfony Twig Translation with link
<trans-unit id="translation.id">
<source>translation.id</source>
<target>Some text <![CDATA[<a href="%link%">%link_text%</a>]]> end of sentence.</target>
</trans-unit>
{% set string_trans = 'string'|trans %}
<strong>{{ 'translation.id'|trans({'%link%': path('symfony_path'), '%link_text%': string_trans})|raw }}</strong>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment