title: How to write that path in string to be parsed - Twig
body: <p>I set links in this way in twig:</p>
  
  <pre><code>{% set link = '&lt;a href=""&gt;('~product.price~)'~product.name~'&lt;/a&gt;' %}
  </code></pre>
  
  <p>The problem is how to fill the link</p>
  
  <pre><code>{% set link = '&lt;a href="'~{{ path('restaurant') }}~'"&gt;('~product.price~)'~product.name~'&lt;/a&gt;' %}
  </code></pre>
  
  <p>This gives me the error: <code>A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "punctuation" of value "{"</code></p>
  
  <pre><code>{% set link = '&lt;a href="{ path('restaurant') }}"&gt;('~product.price~)'~product.name~'&lt;/a&gt;' %}
  </code></pre>
  
  <p><code>Unexpected token "name" of value "restaurant" ("end of statement block" expected)</code></p>
  
  <p>can you please help me :( </p>
  
  <p>The link will also have an id argument.</p>
  
  <p>The only thing I can think of is writing a filter which takes te id as argument and replaces the empty link, but I'm not quite sure it will work, and it doesn't seem like a good solution.</p>