smukm/yii2-bitwise-checkboxlist

Bitwise checkbox`s list for Yii2

v1.0.4 2021-02-08 16:51 UTC

This package is auto-updated.

Last update: 2024-09-09 00:54:42 UTC


README

Installation

Install extension through composer:

composer require smukm/yii2-bitwise-checkboxlist

Usage

The following code in a view file would render a group of checkboxes:

<?= smukm\bcl\BitwiseCheckboxList::widget([
    'name' => 'attributeName',
    'data' => ['1' => 'New', '2' => 'Paid', '4' => 'Delivered', '8' => 'Complete'],
    'columns' => 2,
]) ?>

If you want to use this input widget in an ActiveForm, it can be done like this:

<?= $form->field($model, 'attributeName')->widget(smukm\bcl\BitwiseCheckboxList::class, [
    'data' => ['1' => 'New', '2' => 'Paid', '4' => 'Delivered', '8' => 'Complete'],
]) ?>