Yii2 custom checkboxList like categories in wordpress

0
2928
views

Categories wordpress.

We should understand about checkboxList data. The below is an example with dummy data.

  • Line 5-12 is a dummy data.
  • Line 14 map from array data to array id, name.
  • Line 16, we add a class (‘categories-container’) in container checboxList, to set css border, max-height, scroll auto.
  • Line 18, we use class┬ácheckbox from bootstrap, to make checkbox inline false (vertical not horizontal).
  • Line 19, we add prefix before generate html checkbox.

The result :

Reference :
http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#activeCheckboxList()-detail

LEAVE A REPLY

Please enter your name here
Please enter your comment!