Skip to content

Commit 5f09ab9

Browse files
fix merge
1 parent 7a963dc commit 5f09ab9

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

Resources/views/Form/bootstrap_4_layout.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
<div class="input-group{{ group_class|default('') }}">
1010
{%- if prepend -%}
1111
<div class="input-group-prepend">
12-
<span class="input-group-text">{{ money_pattern|replace({ '{{ widget }}':''}) }}</span>
12+
<span class="input-group-text">{{ money_pattern|form_encode_currency }}</span>
1313
</div>
1414
{%- endif -%}
1515
{{- block('form_widget_simple') -}}
1616
{%- if append -%}
1717
<div class="input-group-append">
18-
<span class="input-group-text">{{ money_pattern|replace({ '{{ widget }}':''}) }}</span>
18+
<span class="input-group-text">{{ money_pattern|form_encode_currency }}</span>
1919
</div>
2020
{%- endif -%}
2121
</div>

Resources/views/Form/bootstrap_base_layout.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
{% if prepend or append %}
1414
<div class="input-group{{ group_class|default('') }}">
1515
{% if prepend %}
16-
<span class="input-group-addon">{{ money_pattern|replace({ '{{ widget }}':''}) }}</span>
16+
<span class="input-group-addon">{{ money_pattern|form_encode_currency }}</span>
1717
{% endif %}
1818
{{- block('form_widget_simple') -}}
1919
{% if append %}
20-
<span class="input-group-addon">{{ money_pattern|replace({ '{{ widget }}':''}) }}</span>
20+
<span class="input-group-addon">{{ money_pattern|form_encode_currency }}</span>
2121
{% endif %}
2222
</div>
2323
{% else %}

Resources/views/Form/foundation_5_layout.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
{% set prepend = '{{' == money_pattern[0:2] %}
2828
{% if not prepend %}
2929
<div class="small-3 large-2 columns">
30-
<span class="prefix">{{ money_pattern|replace({ '{{ widget }}':''}) }}</span>
30+
<span class="prefix">{{ money_pattern|form_encode_currency }}</span>
3131
</div>
3232
{% endif %}
3333
<div class="small-9 large-10 columns">
3434
{{- block('form_widget_simple') -}}
3535
</div>
3636
{% if prepend %}
3737
<div class="small-3 large-2 columns">
38-
<span class="postfix">{{ money_pattern|replace({ '{{ widget }}':''}) }}</span>
38+
<span class="postfix">{{ money_pattern|form_encode_currency }}</span>
3939
</div>
4040
{% endif %}
4141
</div>

Tests/Extension/FormExtensionBootstrap3LayoutTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ public function testMoneyWidgetInIso()
8585
$environment->addExtension(new FormExtension());
8686
$environment->setCharset('ISO-8859-1');
8787

88+
$rendererEngine = new TwigRendererEngine(array(
89+
'bootstrap_3_layout.html.twig',
90+
'custom_widgets.html.twig',
91+
), $environment);
92+
$this->renderer = new FormRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock());
93+
$this->registerTwigRuntimeLoader($environment, $this->renderer);
94+
8895
$view = $this->factory
8996
->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\MoneyType')
9097
->createView()

Tests/Extension/FormExtensionDivLayoutTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ public function testMoneyWidgetInIso()
175175
$environment->addExtension(new FormExtension());
176176
$environment->setCharset('ISO-8859-1');
177177

178+
$rendererEngine = new TwigRendererEngine(array(
179+
'form_div_layout.html.twig',
180+
'custom_widgets.html.twig',
181+
), $environment);
182+
$this->renderer = new FormRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock());
183+
$this->registerTwigRuntimeLoader($environment, $this->renderer);
184+
178185
$view = $this->factory
179186
->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\MoneyType')
180187
->createView()

0 commit comments

Comments
 (0)