Twig inline template

12.01.2018 | Symfony | Twig

{% set bemerkungen_form %} {#% verbatim %#} <form action="{{ url('bemerkung', { 'id' : auftrag.id }) }}" method="POST"> <textarea name="text" >Neue Bemerkung...</textarea>

{% 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 %}


 

Analyse

Entwurf

Development

Launch