Twig inline template

geposted am 12.01.2018, in Symfony Twig

{% set bemerkungen_form %}
{#% verbatim %#}
 <form action="{{ url('bemerkung', { 'id' : auftrag.id  }) }}" method="POST">
    <textarea name="text" >Neue Bemerkung...</textarea>
    <button class="btn btn-primary" type="submit">speichern</button>
</form>
{#% endverbatim %#}
{% endset %}
{% set input_wrapper_tpl = template_from_string(input_wrapper_string) %}

{# Setting the variables #}
{% set label, name = "Age3", "age" %}
{% set controls %}
<select name="age">
    <option>...</option>
</select>
{% endset %}


{# "Rendering" the template #}
{% include input_wrapper_tpl %}