bug #30505 [TwigBridge] Remove usages of the spaceless tag (nicolas-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] Remove usages of the spaceless tag

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

The spaceless tag is deprecated since version 2.7.

Commits
-------

2ee178b5c5 [TwigBridge] Remove use spaceless tag
This commit is contained in:
Nicolas Grekas 2019-03-10 10:57:46 +01:00
commit c6a35ac106
4 changed files with 17 additions and 29 deletions

View File

@ -1,25 +1,19 @@
{% block _text_id_widget %}
{% spaceless %}
{% block _text_id_widget -%}
<div id="container">
{{ form_widget(form) }}
{{- form_widget(form) -}}
</div>
{% endspaceless %}
{% endblock _text_id_widget %}
{%- endblock _text_id_widget %}
{% block _names_entry_label %}
{% spaceless %}
{% block _names_entry_label -%}
{% if label is empty %}
{% set label = name|humanize %}
{% endif %}
{%- set label = name|humanize -%}
{% endif -%}
<label>Custom label: {{ label|trans({}, translation_domain) }}</label>
{% endspaceless %}
{% endblock _names_entry_label %}
{%- endblock _names_entry_label %}
{% block _name_c_entry_label %}
{% spaceless %}
{% block _name_c_entry_label -%}
{% if label is empty %}
{% set label = name|humanize %}
{% endif %}
{%- set label = name|humanize -%}
{% endif -%}
<label>Custom name label: {{ label|trans({}, translation_domain) }}</label>
{% endspaceless %}
{% endblock _name_c_entry_label %}
{%- endblock _name_c_entry_label %}

View File

@ -1,6 +1,4 @@
{% block form_widget_simple %}
{% spaceless %}
{% set type = type|default('text') %}
{%- set type = type|default('text') -%}
<input type="{{ type }}" {{ block('widget_attributes') }} value="{{ value }}" rel="theme" />
{% endspaceless %}
{% endblock form_widget_simple %}
{%- endblock form_widget_simple %}

View File

@ -1,8 +1,6 @@
{% extends 'form_div_layout.html.twig' %}
{% block form_widget_simple %}
{% spaceless %}
{% set type = type|default('text') %}
{%- set type = type|default('text') -%}
<input type="{{ type }}" {{ block('widget_attributes') }} value="{{ value }}" rel="theme" />
{% endspaceless %}
{% endblock form_widget_simple %}
{%- endblock form_widget_simple %}

View File

@ -1,8 +1,6 @@
{% use 'form_div_layout.html.twig' %}
{% block form_widget_simple %}
{% spaceless %}
{% set type = type|default('text') %}
{%- set type = type|default('text') -%}
<input type="{{ type }}" {{ block('widget_attributes') }} value="{{ value }}" rel="theme" />
{% endspaceless %}
{% endblock form_widget_simple %}
{%- endblock form_widget_simple %}