[TwigBridge] renamed some block names to avoid collisions
This commit is contained in:
parent
a30c06a384
commit
627a7f7cd4
10
UPDATE.md
10
UPDATE.md
@ -6,6 +6,16 @@ one. It only discusses changes that need to be done when using the "public"
|
|||||||
API of the framework. If you "hack" the core, you should probably follow the
|
API of the framework. If you "hack" the core, you should probably follow the
|
||||||
timeline closely anyway.
|
timeline closely anyway.
|
||||||
|
|
||||||
|
beta5 to RC1
|
||||||
|
------------
|
||||||
|
|
||||||
|
* Some blocks in the Twig Form templates have been renamed to avoid
|
||||||
|
collisions:
|
||||||
|
|
||||||
|
* `container_attributes` to `widget_container_attributes`
|
||||||
|
* `attributes` to `widget_attributes`
|
||||||
|
* `options` to `widget_choice_options`
|
||||||
|
|
||||||
beta4 to beta5
|
beta4 to beta5
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
@ -47,23 +47,23 @@
|
|||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
{% endblock field_rest %}
|
{% endblock field_rest %}
|
||||||
|
|
||||||
{% block attributes %}
|
{% block widget_attributes %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
id="{{ id }}" name="{{ full_name }}"{% if read_only %} disabled="disabled"{% endif %}{% if required %} required="required"{% endif %}{% if max_length %} maxlength="{{ max_length }}"{% endif %}{% if pattern %} pattern="{{ pattern }}"{% endif %}
|
id="{{ id }}" name="{{ full_name }}"{% if read_only %} disabled="disabled"{% endif %}{% if required %} required="required"{% endif %}{% if max_length %} maxlength="{{ max_length }}"{% endif %}{% if pattern %} pattern="{{ pattern }}"{% endif %}
|
||||||
{% for attrname,attrvalue in attr %}{{attrname}}="{{attrvalue}}" {% endfor %}
|
{% for attrname,attrvalue in attr %}{{attrname}}="{{attrvalue}}" {% endfor %}
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
{% endblock attributes %}
|
{% endblock widget_attributes %}
|
||||||
|
|
||||||
{% block container_attributes %}
|
{% block widget_container_attributes %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
id="{{ id }}"
|
id="{{ id }}"
|
||||||
{% for attrname,attrvalue in attr %}{{attrname}}="{{attrvalue}}" {% endfor %}
|
{% for attrname,attrvalue in attr %}{{attrname}}="{{attrvalue}}" {% endfor %}
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
{% endblock container_attributes %}
|
{% endblock widget_container_attributes %}
|
||||||
|
|
||||||
{% block form_widget %}
|
{% block form_widget %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
<div {{ block('container_attributes') }}>
|
<div {{ block('widget_container_attributes') }}>
|
||||||
{{ block('field_rows') }}
|
{{ block('field_rows') }}
|
||||||
{{ form_rest(form) }}
|
{{ form_rest(form) }}
|
||||||
</div>
|
</div>
|
||||||
@ -73,7 +73,7 @@
|
|||||||
{% block field_widget %}
|
{% block field_widget %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
{% set type = type|default('text') %}
|
{% set type = type|default('text') %}
|
||||||
<input type="{{ type }}" {{ block('attributes') }} value="{{ value }}" />
|
<input type="{{ type }}" {{ block('widget_attributes') }} value="{{ value }}" />
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
{% endblock field_widget %}
|
{% endblock field_widget %}
|
||||||
|
|
||||||
@ -102,11 +102,11 @@
|
|||||||
|
|
||||||
{% block textarea_widget %}
|
{% block textarea_widget %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
<textarea {{ block('attributes') }}>{{ value }}</textarea>
|
<textarea {{ block('widget_attributes') }}>{{ value }}</textarea>
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
{% endblock textarea_widget %}
|
{% endblock textarea_widget %}
|
||||||
|
|
||||||
{% block options %}
|
{% block widget_choice_options %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
{% for choice, label in options %}
|
{% for choice, label in options %}
|
||||||
{% if _form_is_choice_group(label) %}
|
{% if _form_is_choice_group(label) %}
|
||||||
@ -120,29 +120,29 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
{% endblock options %}
|
{% endblock widget_choice_options %}
|
||||||
|
|
||||||
{% block choice_widget %}
|
{% block choice_widget %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
{% if expanded %}
|
{% if expanded %}
|
||||||
<div {{ block('container_attributes') }}>
|
<div {{ block('widget_container_attributes') }}>
|
||||||
{% for choice, child in form %}
|
{% for choice, child in form %}
|
||||||
{{ form_widget(child) }}
|
{{ form_widget(child) }}
|
||||||
{{ form_label(child) }}
|
{{ form_label(child) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<select {{ block('attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
|
<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
|
||||||
{% if empty_value is not none %}
|
{% if empty_value is not none %}
|
||||||
<option value="">{{ empty_value|trans }}</option>
|
<option value="">{{ empty_value|trans }}</option>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if preferred_choices|length > 0 %}
|
{% if preferred_choices|length > 0 %}
|
||||||
{% set options = preferred_choices %}
|
{% set options = preferred_choices %}
|
||||||
{{ block('options') }}
|
{{ block('widget_choice_options') }}
|
||||||
<option disabled="disabled">{{ separator }}</option>
|
<option disabled="disabled">{{ separator }}</option>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% set options = choices %}
|
{% set options = choices %}
|
||||||
{{ block('options') }}
|
{{ block('widget_choice_options') }}
|
||||||
</select>
|
</select>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
@ -150,19 +150,19 @@
|
|||||||
|
|
||||||
{% block checkbox_widget %}
|
{% block checkbox_widget %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
<input type="checkbox" {{ block('attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} />
|
<input type="checkbox" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} />
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
{% endblock checkbox_widget %}
|
{% endblock checkbox_widget %}
|
||||||
|
|
||||||
{% block radio_widget %}
|
{% block radio_widget %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
<input type="radio" {{ block('attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} />
|
<input type="radio" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} />
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
{% endblock radio_widget %}
|
{% endblock radio_widget %}
|
||||||
|
|
||||||
{% block datetime_widget %}
|
{% block datetime_widget %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
<div {{ block('container_attributes') }}>
|
<div {{ block('widget_container_attributes') }}>
|
||||||
{{ form_errors(form.date) }}
|
{{ form_errors(form.date) }}
|
||||||
{{ form_errors(form.time) }}
|
{{ form_errors(form.time) }}
|
||||||
{{ form_widget(form.date) }}
|
{{ form_widget(form.date) }}
|
||||||
@ -176,7 +176,7 @@
|
|||||||
{% if widget == 'single_text' %}
|
{% if widget == 'single_text' %}
|
||||||
{{ block('text_widget') }}
|
{{ block('text_widget') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<div {{ block('container_attributes') }}>
|
<div {{ block('widget_container_attributes') }}>
|
||||||
{{ date_pattern|replace({
|
{{ date_pattern|replace({
|
||||||
'{{ year }}': form_widget(form.year),
|
'{{ year }}': form_widget(form.year),
|
||||||
'{{ month }}': form_widget(form.month),
|
'{{ month }}': form_widget(form.month),
|
||||||
@ -189,7 +189,7 @@
|
|||||||
|
|
||||||
{% block time_widget %}
|
{% block time_widget %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
<div {{ block('container_attributes') }}>
|
<div {{ block('widget_container_attributes') }}>
|
||||||
{{ form_widget(form.hour, { 'attr': { 'size': '1' } }) }}:{{ form_widget(form.minute, { 'attr': { 'size': '1' } }) }}{% if with_seconds %}:{{ form_widget(form.second, { 'attr': { 'size': '1' } }) }}{% endif %}
|
{{ form_widget(form.hour, { 'attr': { 'size': '1' } }) }}:{{ form_widget(form.minute, { 'attr': { 'size': '1' } }) }}{% if with_seconds %}:{{ form_widget(form.second, { 'attr': { 'size': '1' } }) }}{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
{% block form_widget %}
|
{% block form_widget %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
<table {{ block('container_attributes') }}>
|
<table {{ block('widget_container_attributes') }}>
|
||||||
{{ block('field_rows') }}
|
{{ block('field_rows') }}
|
||||||
{{ form_rest(form) }}
|
{{ form_rest(form) }}
|
||||||
</table>
|
</table>
|
||||||
|
Reference in New Issue
Block a user