title: How to pass JavaScript variable to Symfony route using Twig path function
body: <p>I have a small problem with a Javascript variable in a Twig template,
  what I want is to pass a variable as a parameter (in a url) to a function. All I have found on StackOverflow is how to pass a string <strong>'blablabla'</strong> to the URL like:</p>
  
  <pre><code>url/{param}, {'param' : 'blablabla'}
  </code></pre>
  
  <p>but I want something like :</p>
  
  <pre><code>$var =...;
  url/{param}, {'param': $var}
  </code></pre>
  
  <p>this photo should make it clear to you , thanks for reading</p>
  
  <p><a href="https://i.stack.imgur.com/ZQ3Wn.png" rel="nofollow noreferrer">photo</a></p>