vendredi 26 décembre 2014

How to create yii2 inline checkbox list

I have described my problem on yii2 forum, but no one helped me, most likely because no one knows the answer.


Here is the short description here.


I would like to make this:



<label class="checkbox-inline"><input type="checkbox" value="ASD">Option 1</label>
<label class="checkbox-inline"><input type="checkbox" value="DSA">Option 2</label>
<label class="checkbox-inline"><input type="checkbox" value="REW">Option 3</label>


but with yii2 checkboxList Html helper.


This is my simplified array of checkbox values



<?= $form->field($model, 'country')->checkboxList(['FR'=>'France', 'DE'=>'Germany']) ?>


I need to insert the class="checkbox-inline" into the label tags of each checkbox generated by this yii2 helper method but I can not figure out how to do it.


I was following these guides: checkboxList and checkbox one ( I can't post more than 2 links because I am new here ) but they are not helpful to me, I just do not understand what I have to do. Everything I tried just failed.


Can someone help me please, I am trying for 3 days now ?





Aucun commentaire:

Enregistrer un commentaire