bug #26584 [TwigBridge] allow html5 compatible rendering of forms with null names (systemist)

This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #26584).

Discussion
----------

[TwigBridge] allow html5 compatible rendering of forms with null names

Fixes html5 validation error with null form names.

Commits
-------

01c9e3ce70 allow html5 compatible rendering of forms with null names
This commit is contained in:
Fabien Potencier 2018-03-20 09:46:19 +01:00
commit a1be12e290
1 changed files with 1 additions and 1 deletions

View File

@ -275,7 +275,7 @@
{%- else -%}
{% set form_method = "POST" %}
{%- endif -%}
<form name="{{ name }}" method="{{ form_method|lower }}" action="{{ action }}"{% for attrname, attrvalue in attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}{% if multipart %} enctype="multipart/form-data"{% endif %}>
<form{% if name != '' %} name="{{ name }}"{% endif %} method="{{ form_method|lower }}" action="{{ action }}"{% for attrname, attrvalue in attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}{% if multipart %} enctype="multipart/form-data"{% endif %}>
{%- if form_method != method -%}
<input type="hidden" name="_method" value="{{ method }}" />
{%- endif -%}