Symfony 如何使用路径字符串中的参数

Symfony 如何使用路径字符串中的参数,symfony,twig,Symfony,Twig,我正在使用Symfony2和TWIG。使用“路径”,我将打开第二页并设置一些参数 {% set place = "The City" %} <tr> <td class="tdstellenangebot_zelle"> <a href="#" onclick="anzeige_job('{{ path("_anzeige_job",{kznr:102,ort:"unseren Standort in " {{ place }} ,filia

我正在使用Symfony2和TWIG。使用“路径”,我将打开第二页并设置一些参数

{% set place = "The City" %}
<tr>
    <td class="tdstellenangebot_zelle">
        <a href="#" onclick="anzeige_job('{{ path("_anzeige_job",{kznr:102,ort:"unseren Standort in " {{ place }} ,filiale:1} ) }}')">
            The jobdescription
        </a>
    </td>
    <td class="tdstellenangebot_zelle textBold">{{ place }} </td>
</tr>
{%set place=“城市”%}
{{place}}
但是剧本不起作用

如何使用变量设置路径中的位置


非常感谢您的帮助。

您需要简单的连接:

{% set place = "The City" %}
<tr>
    <td class="tdstellenangebot_zelle">
        <a href="#" onclick="anzeige_job('{{ path("_anzeige_job", { kznr: 102, ort:"unseren Standort in " ~ place, filiale: 1 }) }}')">
            The jobdescription
        </a>
    </td>
    <td class="tdstellenangebot_zelle textBold">{{ place }} </td>
</tr>
{%set place=“城市”%}
{{place}}

看看瓷砖符号
~
。它类似于JavaScript中的
+
和PHP中的
,用于连接字符串。

您需要简单的连接:

{% set place = "The City" %}
<tr>
    <td class="tdstellenangebot_zelle">
        <a href="#" onclick="anzeige_job('{{ path("_anzeige_job", { kznr: 102, ort:"unseren Standort in " ~ place, filiale: 1 }) }}')">
            The jobdescription
        </a>
    </td>
    <td class="tdstellenangebot_zelle textBold">{{ place }} </td>
</tr>
{%set place=“城市”%}
{{place}}
看看瓷砖符号
~
。它类似于JavaScript中的
+
和PHP中的
,用于连接字符串