Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Symfony 如何在twig中使用单注释行和多注释行_Symfony_Twig - Fatal编程技术网

Symfony 如何在twig中使用单注释行和多注释行

Symfony 如何在twig中使用单注释行和多注释行,symfony,twig,Symfony,Twig,我是新来的小树枝项目。我需要对此进行注释,如果内容:像//或/**/那样,如何在twig中使用注释 {%if role=3 %} <div class="col-md-6"> <div class="form-group"> <label class="control-label">&nbsp;</label> <select multiple class="form

我是新来的小树枝项目。我需要对此进行注释,如果内容:像//或/**/那样,如何在twig中使用注释

    {%if role=3 %}
<div class="col-md-6">
        <div class="form-group">
           <label class="control-label">&nbsp;</label>
           <select multiple class="form-control"  id="path_attachment" name="path_attachment[]"></select>
        </div>
</div>
{% else %}
<div class="col-md-6"></div>
{% endif %}

希望它能对您有所帮助。

您还可以使用IDE/编辑器配置一个快捷方式,用于注释多行内容


在PhpStorm中,我使用Ctrl+b来完成此操作。

twig命令关键字为。使用{的内部并以}结尾。下面是你需要的答案

    {#%if role=3 %}
<div class="col-md-6">
        <div class="form-group">
           <label class="control-label">&nbsp;</label>
           <select multiple class="form-control"  id="path_attachment" name="path_attachment[]"></select>
        </div>
</div>
{% else %}
<div class="col-md-6"></div>
{% endif %#}

请重新表述你的问题,告诉我们你尝试了什么,得到了什么,你期望得到什么。
    {#%if role=3 %}
<div class="col-md-6">
        <div class="form-group">
           <label class="control-label">&nbsp;</label>
           <select multiple class="form-control"  id="path_attachment" name="path_attachment[]"></select>
        </div>
</div>
{% else %}
<div class="col-md-6"></div>
{% endif %#}