8000 [Form] Fix the money form type render with Bootstrap3 by Th3Mouk · Pull Request #19426 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Fix the money form type render with Bootstrap3 #19426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix the money form type render with Bootstrap3
There is a confusion between the variable naming, and the result expected.

When prepend variable is false, the currency symbol must be add after the widget.
When the money_patternstarts with {{, prepend variable must be false.
  • Loading branch information
Th3Mouk committed Jul 25, 2016
commit 637a4411d749bb0328561da5976470c379f9997f
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

{% block money_widget -%}
<div class="input-group">
{% set prepend = '{{' == money_pattern[0:2] %}
{% if not prepend %}
{% set append = money_pattern starts with '{{' %}
{% if not append %}
<span class="input-group-addon">{{ money_pattern|replace({ '{{ widget }}':''}) }}</span>
{% endif %}
{{- block('form_widget_simple') -}}
{% if prepend %}
{% if append %}
<span class="input-group-addon">{{ money_pattern|replace({ '{{ widget }}':''}) }}</span>
{% endif %}
</div>
Expand Down
0