From fbfeec1e63d80611810d5bc056a442bfafbfad85 Mon Sep 17 00:00:00 2001 From: Romaric Drigon Date: Fri, 11 Oct 2019 15:03:29 +0200 Subject: [PATCH] Documentation for Bootstrap 4 custom switches --- form/bootstrap4.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/form/bootstrap4.rst b/form/bootstrap4.rst index 330ed2a165e..7448b83b98f 100644 --- a/form/bootstrap4.rst +++ b/form/bootstrap4.rst @@ -92,13 +92,17 @@ Custom Forms ------------ Bootstrap 4 has a feature called "`custom forms`_". You can enable that on your -Symfony Form ``RadioType`` and ``CheckboxType`` by adding a class called ``radio-custom`` -and ``checkbox-custom`` respectively. +Symfony Form ``RadioType`` and ``CheckboxType`` by adding some classes over the label: + +- for radio, use ``radio-custom`` +- for a custom checkbox, use ``checkbox-custom`` +- for having a switch instead of a checkbox, use ``switch-custom`` .. code-block:: twig {{ form_row(form.myRadio, {label_attr: {class: 'radio-custom'} }) }} {{ form_row(form.myCheckbox, {label_attr: {class: 'checkbox-custom'} }) }} + {{ form_row(form.myCheckbox, {label_attr: {class: 'switch-custom'} }) }} Labels and Errors -----------------