Answer the question
In order to leave comments, you need to log in
How to change the value of the CheckBox that will be sent to the database?
How to make the checkbox value on the page displayed like this:
And the id of this value was passed to the database
Tried to do this
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'time_rec')->checkboxList(\yii\helpers\ArrayHelper::map(\app\models\Worktime::find()->all(),'id','time_work'))->label('') ?>
<div class="form-group">
<?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question