Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e1f66cc

Browse filesBrowse files
committed
[TwigBridge][Form] Added missing help messages for checkboxes in 3 themes
1 parent 8855082 commit e1f66cc
Copy full SHA for e1f66cc

6 files changed

+55
-0
lines changed

‎src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ col-sm-10
6464
<div class="{{ block('form_label_class') }}"></div>{#--#}
6565
<div class="{{ block('form_group_class') }}">
6666
{{- form_widget(form) -}}
67+
{{- form_help(form) -}}
6768
{{- form_errors(form) -}}
6869
</div>{#--#}
6970
</div>

‎src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
{% block checkbox_row -%}
149149
<div{% with {attr: row_attr|merge({class: (row_attr.class|default('') ~ ' form-group' ~ (not valid ? ' has-error'))|trim})} %}{{ block('attributes') }}{% endwith %}>
150150
{{- form_widget(form) -}}
151+
{{- form_help(form) -}}
151152
{{- form_errors(form) -}}
152153
</div>
153154
{%- endblock checkbox_row %}

‎src/Symfony/Bridge/Twig/Resources/views/Form/foundation_5_layout.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Resources/views/Form/foundation_5_layout.html.twig
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@
311311
<div{% with {attr: row_attr|merge({class: (row_attr.class|default('') ~ ' row')|trim})} %}{{ block('attributes') }}{% endwith %}>
312312
<div class="large-12 columns{% if not valid %} error{% endif %}">
313313
{{ form_widget(form) }}
314+
{{- form_help(form) -}}
314315
{{ form_errors(form) }}
315316
</div>
316317
</div>

‎src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3HorizontalLayoutTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3HorizontalLayoutTest.php
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,24 @@ public function testCheckboxRow()
163163

164164
$this->assertMatchesXpath($html, '/div[@class="form-group"]/div[@class="col-sm-2" or @class="col-sm-10"]', 2);
165165
}
166+
167+
public function testCheckboxRowWithHelp()
168+
{
169+
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType');
170+
$view = $form->createView();
171+
$html = $this->renderRow($view, ['label' => 'foo', 'help' => 'really helpful text']);
172+
173+
$this->assertMatchesXpath($html,
174+
'/div
175+
[@class="form-group"]
176+
[
177+
./div[@class="col-sm-2" or @class="col-sm-10"]
178+
/following-sibling::div[@class="col-sm-2" or @class="col-sm-10"]
179+
[
180+
./span[text() = "[trans]really helpful text[/trans]"]
181+
]
182+
]
183+
'
184+
);
185+
}
166186
}

‎src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,22 @@ public function testCheckboxWithValue()
333333
);
334334
}
335335

336+
public function testCheckboxRowWithHelp()
337+
{
338+
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType');
339+
$view = $form->createView();
340+
$html = $this->renderRow($view, ['label' => 'foo', 'help' => 'really helpful text']);
341+
342+
$this->assertMatchesXpath($html,
343+
'/div
344+
[@class="form-group"]
345+
[
346+
./span[text() = "[trans]really helpful text[/trans]"]
347+
]
348+
'
349+
);
350+
}
351+
336352
public function testSingleChoice()
337353
{
338354
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [

‎src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,22 @@ public function testCheckboxWithValue()
422422
);
423423
}
424424

425+
public function testCheckboxRowWithHelp()
426+
{
427+
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType');
428+
$view = $form->createView();
429+
$html = $this->renderRow($view, ['label' => 'foo', 'help' => 'really helpful text']);
430+
431+
$this->assertMatchesXpath($html,
432+
'/div
433+
[@class="form-group"]
434+
[
435+
./small[text() = "[trans]really helpful text[/trans]"]
436+
]
437+
'
438+
);
439+
}
440+
425441
public function testSingleChoiceExpanded()
426442
{
427443
$form = $this->factory->createNamed('name', ChoiceType::class, '&a', [

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.