0

Does anyone know the correct syntaxe for a path (in twig) with multiple variables.

I know how to do it for just one variable but for more than one cannot find any syntax explanation/document.

Here for one variable: (but I would like more that one... like variable1_name = article_id and variable2_name = language)

  <li><a href="{{ path('RouteName', {'variable1_name': variable1_value}) }}"></a></li>

Thanks

1 Answer 1

1

List them with commas in between:

<li><a href="{{ path('RouteName', {'variable1_name': variable1_value, 'variable2_name': variable2_value, 'variable3_name': variable3_value}) }}"></a></li>
Sign up to request clarification or add additional context in comments.

2 Comments

ok thanks dmnptr. It works fine indeed. DO you know a good website where the syntaxe for symfony and twig is explained. I couldn't find much about it. even it was not to dificult to find an answer.
My primary source is the official Symfony docs - symfony.com/doc/current/index.html.

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.