I am using Yii2 framework and I'd like to generate an html code like this
<input type="checkbox" id="queue-order" name="Queue[order]" value="1" checked>
in a view which uses ActiveForm.
I've tried
echo $form->field($model, 'order')
->checkBox(['label' => ..., 'uncheck' => null, 'checked' => true]);
as well as
echo $form->field($model, 'order')
->checkBox(['label' => ..., 'uncheck' => null, 'checked' => 'checked']);
but desired string "checked" does not appear in the generated html code.
Strangely enough, if I substitute "checked" with "selected"
echo $form->field($model, 'order')
->checkBox(['label' => ..., 'uncheck' => null, 'selected' => true]);
then generated html code contains attribute "selected":
<input type="checkbox" id="queue-order" name="Queue[order]" value="1" selected>
So, how can I generate html code for a checkbox with attribute "checked"?