douyue5856 2015-01-02 16:04
浏览 40

Symfony表单在twig文件中工作,但不适用于扩展布局

I created a mailform in Symfony2 framework which works but when i add the twig extend method it doesn't work.

I got stuck here so hopefully you can help me!

The form works with the following twig code:

{% block content %}
    {{form(form)}}
{% endblock %}

But it doesn't work with the following twig code:

{% extends 'TMCBundle::layout.html.twig' %}


{% block content %}
    {{form(form)}}
{% endblock %} 

EDIT: Sorry, i forgot to tell: the submit button won't work, so the form action is not triggered.

  • 写回答

1条回答 默认 最新

  • drydaenth257216154 2015-01-02 17:54
    关注

    It was Derick F's answer: I got a javascript that listened to the form...! Thanks!

    评论

报告相同问题?