bug #15446 [Twig][Bridge] force space between widget and label in checkbox_radio_label (MatTheCat)

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

Discussion
----------

[Twig][Bridge] force space between widget and label in checkbox_radio_label

| Q             | A
| ------------- | ---
| Fixed tickets | N/A
| License       | MIT

Update

![without space](https://cloud.githubusercontent.com/assets/1898254/9058780/481326ae-3aa4-11e5-9a8a-ebd6bf963361.png)

to

![with space](https://cloud.githubusercontent.com/assets/1898254/9058791/52184238-3aa4-11e5-854f-4a8105dacb84.png)

Commits
-------

ed9c610 [Twig][Bridge] force space between widget and label in checkbox_radio_label
This commit is contained in:
Fabien Potencier 2015-09-28 11:09:47 +02:00
commit c43bf08b09
2 changed files with 14 additions and 15 deletions

View File

@ -170,8 +170,7 @@
{% set label = name|humanize %}
{% endif %}
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
{{- widget|raw -}}
{{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}}
{{- widget|raw }} {{ label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}}
</label>
{% endif %}
{% endblock checkbox_radio_label %}

View File

@ -162,7 +162,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
[@class="checkbox"]
[
./label
[.="[trans]Name[/trans]"]
[.=" [trans]Name[/trans]"]
[
./input[@type="checkbox"][@name="name"][@id="my&id"][@class="my&class"][@checked="checked"][@value="1"]
]
@ -180,7 +180,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
[@class="checkbox"]
[
./label
[.="[trans]Name[/trans]"]
[.=" [trans]Name[/trans]"]
[
./input[@type="checkbox"][@name="name"][@id="my&id"][@class="my&class"][not(@checked)]
]
@ -200,7 +200,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
[@class="checkbox"]
[
./label
[.="[trans]Name[/trans]"]
[.=" [trans]Name[/trans]"]
[
./input[@type="checkbox"][@name="name"][@id="my&id"][@class="my&class"][@value="foo&bar"]
]
@ -632,7 +632,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
[@class="radio"]
[
./label
[.="[trans]Choice&A[/trans]"]
[.=" [trans]Choice&A[/trans]"]
[
./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
]
@ -641,7 +641,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
[@class="radio"]
[
./label
[.="[trans]Choice&B[/trans]"]
[.=" [trans]Choice&B[/trans]"]
[
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
]
@ -742,7 +742,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
[@class="radio"]
[
./label
[.="[trans]Test&Me[/trans]"]
[.=" [trans]Test&Me[/trans]"]
[
./input[@type="radio"][@name="name"][@id="name_placeholder"][not(@checked)]
]
@ -751,7 +751,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
[@class="radio"]
[
./label
[.="[trans]Choice&A[/trans]"]
[.=" [trans]Choice&A[/trans]"]
[
./input[@type="radio"][@name="name"][@id="name_0"][@checked]
]
@ -760,7 +760,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
[@class="radio"]
[
./label
[.="[trans]Choice&B[/trans]"]
[.=" [trans]Choice&B[/trans]"]
[
./input[@type="radio"][@name="name"][@id="name_1"][not(@checked)]
]
@ -786,7 +786,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
[@class="radio"]
[
./label
[.="[trans]Choice&A[/trans]"]
[.=" [trans]Choice&A[/trans]"]
[
./input[@type="radio"][@name="name"][@id="name_0"][@checked]
]
@ -795,7 +795,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
[@class="radio"]
[
./label
[.="[trans]Choice&B[/trans]"]
[.=" [trans]Choice&B[/trans]"]
[
./input[@type="radio"][@name="name"][@id="name_1"][not(@checked)]
]
@ -822,7 +822,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
[@class="checkbox"]
[
./label
[.="[trans]Choice&A[/trans]"]
[.=" [trans]Choice&A[/trans]"]
[
./input[@type="checkbox"][@name="name[]"][@id="name_0"][@checked][not(@required)]
]
@ -831,7 +831,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
[@class="checkbox"]
[
./label
[.="[trans]Choice&B[/trans]"]
[.=" [trans]Choice&B[/trans]"]
[
./input[@type="checkbox"][@name="name[]"][@id="name_1"][not(@checked)][not(@required)]
]
@ -840,7 +840,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
[@class="checkbox"]
[
./label
[.="[trans]Choice&C[/trans]"]
[.=" [trans]Choice&C[/trans]"]
[
./input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
]