Skip to content

Commit d379dae

Browse files
committed
feature #12464 [Form] Documented "Supporting Bootstrap 4 custom switches" (romaricdrigon)
This PR was merged into the 4.4 branch. Discussion ---------- [Form] Documented "Supporting Bootstrap 4 custom switches" Hello, This PR add the doc for the corresponding proposed feature, custom switch support in default form theme: ![image](https://user-images.githubusercontent.com/919405/66652902-1919fa00-ec37-11e9-98f3-9340b01b2335.png) See the Symfony PR for implementation details. Commits ------- fbfeec1 Documentation for Bootstrap 4 custom switches
2 parents dd656d9 + fbfeec1 commit d379dae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

form/bootstrap4.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,17 @@ Custom Forms
9292
------------
9393

9494
Bootstrap 4 has a feature called "`custom forms`_". You can enable that on your
95-
Symfony Form ``RadioType`` and ``CheckboxType`` by adding a class called ``radio-custom``
96-
and ``checkbox-custom`` respectively.
95+
Symfony Form ``RadioType`` and ``CheckboxType`` by adding some classes over the label:
96+
97+
- for radio, use ``radio-custom``
98+
- for a custom checkbox, use ``checkbox-custom``
99+
- for having a switch instead of a checkbox, use ``switch-custom``
97100

98101
.. code-block:: twig
99102
100103
{{ form_row(form.myRadio, {label_attr: {class: 'radio-custom'} }) }}
101104
{{ form_row(form.myCheckbox, {label_attr: {class: 'checkbox-custom'} }) }}
105+
{{ form_row(form.myCheckbox, {label_attr: {class: 'switch-custom'} }) }}
102106
103107
Labels and Errors
104108
-----------------

0 commit comments

Comments
 (0)