I discovered that you can tell symfony to generate forms in bootstrap way, by adding this in your twig.yaml file
twig:
form_themes: ['bootstrap_4_layout.html.twig']
this renders renders checkbox in normal bootstrap way like this:
<fieldset class="form-group">
<legend class="col-form-label required">Subjects</legend>
<div id="form_subjects">
<div class="form-check">
<input type="checkbox" id="form_subjects_0" name="form[subjects][]" class="form-check-input" value="1">
<label class="form-check-label" for="form_subjects_0">4IZ110</label>
</div>
<div class="form-check">
<input type="checkbox" id="form_subjects_1" name="form[subjects][]" class="form-check-input" value="2">
<label class="form-check-label" for="form_subjects_1">4MA106</label>
</div>
</div>
</fieldset>
this it awesome, but I'd like to generate it as custom forms in this fashion (I'm using bootswatch template):
<div class="form-group">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customCheck1" checked="">
<label class="custom-control-label" for="customCheck1">Check this custom checkbox</label>
</div>
</div>
I've found in symfony documentation that you can "generate forms as custom", but that was just based upon adding class="checkbox-custom" to element <div id="form_subjects">
So my question is: Is there a way to generate custom bootstrap checkboxes (and radio buttons) natively? Or do I have to rewrite bootstrap_4_layout.html.twig?