Send checkbox value

Hi!

I have a simple question:

In view:


<?= Html::checkbox('korespAdres', false) ?>

Value ‘korespAdres’ does not exists in my model.

I want read this value in post, but in $_POST array value is missing.

Should I create another model? What is best way?

Thank you for answer.

Daniel

If you want the value of checkbox to be sent event in case it is not checked add this option:


<?= Html::checkbox('korespAdres', false, ['uncheck' => 0]) ?>

where value of ‘uncheck’ is the value sent to server via hidden input in case checkbox is not checked.