From 637a4411d749bb0328561da5976470c379f9997f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81my=20Marodon?= Date: Mon, 25 Jul 2016 15:48:42 +0200 Subject: [PATCH] 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. --- .../Twig/Resources/views/Form/bootstrap_3_layout.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig index ef2035ab43..3e9f133d37 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig @@ -21,12 +21,12 @@ {% block money_widget -%}
- {% set prepend = '{{' == money_pattern[0:2] %} - {% if not prepend %} + {% set append = money_pattern starts with '{{' %} + {% if not append %} {{ money_pattern|replace({ '{{ widget }}':''}) }} {% endif %} {{- block('form_widget_simple') -}} - {% if prepend %} + {% if append %} {{ money_pattern|replace({ '{{ widget }}':''}) }} {% endif %}