8000 [TwigBridge] Amend `MoneyType` twig to include a space by mogilvie · Pull Request #48335 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
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
Amend MoneyType twig to include a space.
  • Loading branch information
mogilvie authored and fabpot committed Dec 1, 2022
commit aa2dce7b6046e4e7e1194a4e979de8c5cb9cdd3c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{%- set prepend = not (money_pattern starts with '{{') -%}
{%- set append = not (money_pattern ends with '}}') -%}
{%- if prepend or append -%}
<div class="input-group{{ group_class|default('') }}">
<div class="input-group {{ group_class|default('') }}">
{%- if prepend -%}
<div class="input-group-prepend">
<span class="input-group-text">{{ money_pattern|form_encode_currency }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{%- set prepend = not (money_pattern starts with '{{') -%}
{%- set append = not (money_pattern ends with '}}') -%}
{%- if prepend or append -%}
<div class="input-group{{ group_class|default('') }}">
<div class="input-group {{ group_class|default('') }}">
{%- if prepend -%}
<span class="input-group-text">{{ money_pattern|form_encode_currency }}</span>
{%- endif -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% set prepend = not (money_pattern starts with '{{') %}
{% set append = not (money_pattern ends with '}}') %}
{% if prepend or append %}
<div class="input-group{{ group_class|default('') }}">
<div class="input-group {{ group_class|default('') }}">
{% if prepend %}
<span class="input-group-addon">{{ money_pattern|form_encode_currency }}</span>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ public function testMoney()

$this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']],
'/div
[@class="input-group"]
[@class="input-group "]
[
./div
[@class="input-group-prepend"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ public function testMoney()

$this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']],
'/div
[@class="input-group"]
[@class="input-group "]
[
./span
[@class="input-group-text"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function testMoneyWidgetInIso()
;

$this->assertSame(<<<'HTML'
<div class="input-group"><div class="input-group-prepend">
<div class="input-group "><div class="input-group-prepend">
<span class="input-group-text">&euro; </span>
</div><input type="text" id="name" name="name" required="required" class="form-control" /></div>
HTML
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function testMoneyWidgetInIso()
->createView();

self::assertSame(<<<'HTML'
<div class="input-group"><span class="input-group-text">&euro; </span><input type="text" id="name" name="name" required="required" class="form-control" /></div>
<div class="input-group "><span class="input-group-text">&euro; </span><input type="text" id="name" name="name" required="required" class="form-control" /></div>
HTML
, trim($this->renderWidget($view)));
}
Expand Down
0