Skip to content

Improved Bootstrap form theme for hidden fields #17568

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

Closed
wants to merge 6 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{# Widgets #}

{% block form_widget_simple -%}
{% if type is not defined or 'file' != type %}
{% if type is not defined or type not in ['file', 'hidden'] %}
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control')|trim}) -%}
{% endif %}
{{- parent() -}}
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Twig/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"require-dev": {
"symfony/asset": "~2.7",
"symfony/finder": "~2.3",
"symfony/form": "~2.7,>=2.7.8",
"symfony/form": "~2.7.10|~2.8.3",
"symfony/http-kernel": "~2.3",
"symfony/intl": "~2.3",
"symfony/routing": "~2.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ public function testSingleChoiceExpanded()
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
]
]
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
/following-sibling::input[@type="hidden"][@id="name__token"]
]
'
);
Expand Down Expand Up @@ -701,7 +701,7 @@ public function testSingleChoiceExpandedWithoutTranslation()
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
]
]
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
/following-sibling::input[@type="hidden"][@id="name__token"]
]
'
);
Expand Down Expand Up @@ -740,7 +740,7 @@ public function testSingleChoiceExpandedAttributes()
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]'.$classPart.'
]
]
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
/following-sibling::input[@type="hidden"][@id="name__token"]
]
'
);
Expand Down Expand Up @@ -786,7 +786,7 @@ public function testSingleChoiceExpandedWithPlaceholder()
./input[@type="radio"][@name="name"][@id="name_1"][not(@checked)]
]
]
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
/following-sibling::input[@type="hidden"][@id="name__token"]
]
'
);
Expand Down Expand Up @@ -822,7 +822,7 @@ public function testSingleChoiceExpandedWithBooleanValue()
./input[@type="radio"][@name="name"][@id="name_1"][not(@checked)]
]
]
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
/following-sibling::input[@type="hidden"][@id="name__token"]
]
'
);
Expand Down Expand Up @@ -868,7 +868,7 @@ public function testMultipleChoiceExpanded()
./input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
]
]
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
/following-sibling::input[@type="hidden"][@id="name__token"]
]
'
);
Expand Down Expand Up @@ -915,7 +915,7 @@ public function testMultipleChoiceExpandedWithoutTranslation()
./input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
]
]
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
/following-sibling::input[@type="hidden"][@id="name__token"]
]
'
);
Expand Down Expand Up @@ -964,7 +964,7 @@ public function testMultipleChoiceExpandedAttributes()
./input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
]
]
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
/following-sibling::input[@type="hidden"][@id="name__token"]
]
'
);
Expand Down Expand Up @@ -1466,7 +1466,7 @@ public function testHidden()
'/input
[@type="hidden"]
[@name="name"]
[@class="my&class form-control"]
[@class="my&class"]
[@value="foo&bar"]
'
);
Expand Down