8000 Fix some mistakes · symfony/symfony@d723756 · GitHub
[go: up one dir, main page]

Skip to content

Commit d723756

Browse files
committed
Fix some mistakes
1 parent c74e0dc commit d723756

File tree

9 files changed

+50
-32
lines changed

9 files changed

+50
-32
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@ col-sm-2
3434
{{- form_help(form) -}}
3535
{{- form_errors(form) -}}
3636
</div>
37-
{##}</div>
37+
</div>
3838
{%- endblock form_row %}
3939

4040
{% block submit_row -%}
41-
<div class="form-group">{#--#}
42-
<div class="{{ block('form_label_class') }}"></div>{#--#}
41+
<div class="form-group">
42+
<div class="{{ block('form_label_class') }}"></div>
4343
<div class="{{ block('form_group_class') }}">
4444
{{- form_widget(form) -}}
45-
</div>{#--#}
45+
</div>
4646
</div>
4747
{%- endblock submit_row %}
4848

4949
{% block reset_row -%}
50-
<div class="form-group">{#--#}
51-
<div class="{{ block('form_label_class') }}"></div>{#--#}
50+
<div class="form-group">
51+
<div class="{{ block('form_label_class') }}"></div>
5252
<div class="{{ block('form_group_class') }}">
5353
{{- form_widget(form) -}}
54-
</div>{#--#}
54+
</div>
5555
</div>
5656
{%- endblock reset_row %}
5757

@@ -60,11 +60,11 @@ col-sm-10
6060
{%- endblock form_group_class %}
6161

6262
{% block checkbox_row -%}
63-
<div class="form-group{% if not valid %} has-error{% endif %}">{#--#}
64-
<div class="{{ block('form_label_class') }}"></div>{#--#}
63+
<div class="form-group{% if not valid %} has-error{% endif %}">
64+
<div class="{{ block('form_label_class') }}"></div>
6565
<div class="{{ block('form_group_class') }}">
6666
{{- form_widget(form) -}}
6767
{{- form_errors(form) -}}
68-
</div>{#--#}
68+
</div>
6969
</div>
7070
{%- endblock checkbox_row %}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@
159159

160160
{% block form_help -%}
161161
{%- if help is not empty -%}
162-
<span id="{{ id }}_help" class="help-block">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</span>
162+
<span id="{{ id }}_help" class="help-block">
163+
{%- if translation_domain is same as(false) -%}
164+
{{- help -}}
165+
{%- else -%}
166+
{{- help|trans({}, translation_domain) -}}
167+
{%- endif -%}
168+
</span>
163169
{%- endif -%}
164170
{%- endblock form_help %}

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ col-sm-2
3434
{{- form_widget(form, widget_attr) -}}
3535
{{- form_help(form) -}}
3636
</div>
37-
{##}</div>
37+
</div>
3838
{%- endif -%}
3939
{%- endblock form_row %}
4040

@@ -51,24 +51,24 @@ col-sm-2
5151
{{- form_help(form) -}}
5252
</div>
5353
</div>
54-
{##}</fieldset>
54+
</fieldset>
5555
{%- endblock fieldset_form_row %}
5656

5757
{% block submit_row -%}
58-
<div class="form-group row">{#--#}
59-
<div class="{{ block('form_label_class') }}"></div>{#--#}
58+
<div class="form-group row">
59+
<div class="{{ block('form_label_class') }}"></div>
6060
<div class="{{ block('form_group_class') }}">
6161
{{- form_widget(form) -}}
62-
</div>{#--#}
62+
</div>
6363
</div>
6464
{%- endblock submit_row %}
6565

6666
{% block reset_row -%}
67-
<div class="form-group row">{#--#}
68-
<div class="{{ block('form_label_class') }}"></div>{#--#}
67+
<div class="form-group row">
68+
<div class="{{ block('form_label_class') }}"></div>
6969
<div class="{{ block('form_group_class') }}">
7070
{{- form_widget(form) -}}
71-
</div>{#--#}
71+
</div>
7272
</div>
7373
{%- endblock reset_row %}
7474

@@ -77,11 +77,11 @@ col-sm-10
7777
{%- endblock form_group_class %}
7878

7979
{% block checkbox_row -%}
80-
<div class="form-group row">{#--#}
81-
<div class="{{ block('form_label_class') }}"></div>{#--#}
80+
<div class="form-group row">
81+
<div class="{{ block('form_label_class') }}"></div>
8282
<div class="{{ block('form_group_class') }}">
8383
{{- form_widget(form) -}}
8484
{{- form_errors(form) -}}
85-
</div>{#--#}
85+
</div>
8686
</div>
8787
{%- endblock checkbox_row %}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,12 @@
286286

287287
{% block form_help -%}
288288
{%- if help is not empty -%}
289-
<small id="{{ id }}_help" class="form-text text-muted">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</small>
289+
<small id="{{ id }}_help" class="form-text text-muted">
290+
{%- if translation_domain is same as(false) -%}
291+
{{- help -}}
292+
{%- else -%}
293+
{{- help|trans({}, translation_domain) -}}
294+
{%- endif -%}
295+ 10000
</small>
290296
{%- endif -%}
291297
{%- endblock form_help %}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,13 @@
291291

292292
{% block form_help -%}
293293
{%- if help is not empty -%}
294-
<p id="{{ id }}_help" class="help-text">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</p>
294+
<p id="{{ id }}_help" class="help-text">
295+
{%- if translation_domain is same as(false) -%}
296+
{{- help -}}
297+
{%- else -%}
298+
{{- help|trans({}, translation_domain) -}}
299+
{%- endif -%}
300+
</p>
295301
{%- endif -%}
296302
{%- endblock form_help %}
297303

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div>
2-
<?php $widgetAtt = empty($help) ? array() : array('attr' => array('aria-describedby' => $id.'_help')); ?>
2+
<?php $widgetAttr = empty($help) ? array() : array('attr' => array('aria-describedby' => $id.'_help')); ?>
33
<?php echo $view['form']->label($form); ?>
44
<?php echo $view['form']->errors($form); ?>
5-
<?php echo $view['form']->widget($form, $widgetAtt); ?>
5+
<?php echo $view['form']->widget($form, $widgetAttr); ?>
66
<?php echo $view['form']->help($form); ?>
77
</div>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
id="<?php echo $view->escape($id); ?>" name="<?php echo $view->escape($full_name); ?>"<?php if ($disabled): ?> disabled="disabled"<?php endif; ?>
2-
<?php if ($required): ?> required="required"<?php endif; ?>
3-
<?php echo $attr ? ' '.$view['form']->block($form, 'attributes') : ''; ?>
1+
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>"<?php if ($disabled): ?> disabled="disabled"<?php endif ?>
2+
<?php if ($required): ?> required="required"<?php endif ?>
3+
<?php echo $attr ? ' '.$view['form']->block($form, 'attributes') : '' ?>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<tr>
2-
<?php $widgetAtt = empty($help) ? array() : array('attr' => array('aria-describedby' => $id.'_help')); ?>
2+
<?php $widgetAttr = empty($help) ? array() : array('attr' => array('aria-describedby' => $id.'_help')); ?>
33
<td>
44
<?php echo $view['form']->label($form); ?>
55
</td>
66
<td>
77
<?php echo $view['form']->errors($form); ?>
8-
<?php echo $view['form']->widget($form, $widgetAtt); ?>
8+
<?php echo $view['form']->widget($form, $widgetAttr); ?>
99
<?php echo $view['form']->help($form); ?>
1010
</td>
1111
</tr>

src/Symfony/Component/Form/Extension/Core/Type/FormType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public function configureOptions(OptionsResolver $resolver)
184184

185185
$resolver->setAllowedTypes('label_attr', 'array');
186186
$resolver->setAllowedTypes('upload_max_size_message', array('callable'));
187-
$resolver->setAllowedTypes('help', array('string', 'NULL'));
187+
$resolver->setAllowedTypes('help', array('string', 'null'));
188188
}
189189

190190
/**

0 commit comments

Comments
 (0)
0