8000 Rename help id (snake_case) · symfony/symfony@f948147 · GitHub
[go: up one dir, main page]

Skip to content

Commit f948147

Browse files
Mathieu Piotmpiot
Mathieu Piot
authored andcommitted
Rename help id (snake_case)
1 parent 77fa317 commit f948147

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,6 @@
155155

156156
{% block form_help -%}
157157
{% if help is not empty %}
158-
<span id="{{ id }}HelpBlock" class="help-block">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</span>
158+
<span id="{{ id }}_help" class="help-block">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</span>
159159
{% endif %}
160160
{%- endblock form_help %}

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,6 @@
282282

283283
{% block form_help -%}
284284
{% if help is not empty %}
285-
<small id="{{ id }}HelpBlock" class="form-text text-muted">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</small>
285+
<small id="{{ id }}_help" class="form-text text-muted">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</small>
286286
{% endif %}
287287
{%- endblock form_help %}

src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291

292292
{% block form_help -%}
293293
{% if help is not empty %}
294-
<p id="{{ id }}HelpBlock" class="help-text">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</p>
294+
<p id="{{ id }}_help" class="help-text">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</p>
295295
{% endif %}
296296
{%- endblock form_help %}
297297

@@ -397,7 +397,7 @@
397397
id="{{ id }}" name="{{ full_name }}"
398398
{%- if disabled %} disabled="disabled"{% endif -%}
399399
{%- if required %} required="required"{% endif -%}
400-
{%- if helpBlockDisplayed is defined and helpBlockDisplayed and help is not empty %} aria-describedby="{{ id }}HelpBlock"{% endif -%}
400+
{%- if helpBlockDisplayed is defined and helpBlockDisplayed is same as(true) and help is not empty %} aria-describedby="{{ id }}_help"{% endif -%}
401401
{{ block('attributes') }}
402402
{%- endblock widget_attributes -%}
403403

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php if (!empty($help)): ?>
2-
<p id="<?php echo $view->escape($id) ?>HelpBlock" class="help-text"><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($help, array(), $translation_domain) : $help) ?></p>
2+
<p id="<?php echo $view->escape($id) ?>_help" class="help-text"><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($help, array(), $translation_domain) : $help) ?></p>
33
<?php endif ?>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>"<?php if ($disabled): ?> disabled="disabled"<?php endif ?>
22
<?php if ($required): ?> required="required"<?php endif ?>
3-
<?php if (isset($helpBlockDisplayed) && $helpBlockDisplayed && !empty($help)): ?> aria-describedby="<?php echo $view->escape($id) ?>HelpBlock"<?php endif ?>
3+
<?php if (isset($helpBlockDisplayed) && true === $helpBlockDisplayed && !empty($help)): ?> aria-describedby="<?php echo $view->escape($id) ?>_help"<?php endif ?>
44
<?php echo $attr ? ' '.$view['form']->block($form, 'attributes') : '' ?>

src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function testHelp()
112112

113113
$this->assertMatchesXpath($html,
114114
'/span
115-
[@id="nameHelpBlock"]
115+
[@id="name_help"]
116116
[@class="help-block"]
117117
[.="[trans]Help text test![/trans]"]
118118
'

src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function testHelp()
161161

162162
$this->assertMatchesXpath($html,
163163
'/small
164-
[@id="nameHelpBlock"]
164+
[@id="name_help"]
165165
[@class="form-text text-muted"]
166166
[.="[trans]Help text test![/trans]"]
167167
'

src/Symfony/Component/Form/Tests/AbstractLayoutTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ public function testHelp()
420420

421421
$this->assertMatchesXpath($html,
422422
'/p
423-
[@id="nameHelpBlock"]
423+
[@id="name_help"]
424424
[@class="help-text"]
425425
[.="[trans]Help text test![/trans]"]
426426
'
@@ -446,7 +446,7 @@ public function testHelpSetLinkFromWidget()
446446

447447
$this->assertMatchesXpath($html,
448448
'/input
449-
[@aria-describedby="nameHelpBlock"]
449+
[@aria-describedby="name_help"]
450450
'
451451
);
452452
}

0 commit comments

Comments
 (0)
0