Hi
I am adding multiple checkbox but facing issue but adding classes to parent div.
HTML output should be like this
<div class="custom-control custom-control-primary custom-checkbox">
<input type="checkbox" class="custom-control-input" id="colorCheck1" checked="">
<label class="custom-control-label" for="colorCheck1">Primary</label>
</div>
I am trying to use this code
<?php
$list = ['1'=>'Select 1','2'=>'Select 2']; /*Array of list */
echo $this->Form->select('profile_ids', $list, [
'multiple' => 'checkbox', 'class'=>'custom-control-input',
'label' => ['class' => 'custom-control-label'],
'templates' => ['inputContainer' => '<div class="custom-control custom-control-primary custom-checkbox">{{content}}</div>']
]);
and i am getting this code in html that is not what i want
<div class="checkbox">
<label class="custom-control-label" for="profile-ids-13">
<input type="checkbox" name="profile_ids[]" value="13" id="profile-ids-13" class="custom-control-input" templates="<div class="custom-control custom-control-primary custom-checkbox">{{content}}</div>">default
</label>
</div>
Please help how to get desired checkbox.
Thanks