<?= $form->field($model, 'test', ['options' => ['class' => 'input-field col s12 m4'],
'template' => '{input}{label}'])->input('checkbox');?>
<?= $form->field($model, 'test', ['options' => ['class' => 'input-field col s12 m4'],
'template' => '{input}{label}'])->input('checkbox', ['checked' => $x < 10]);?>
<?php $model->test = $x < 10; ?>
<?= $form->field($model, 'test', ['options' => ['class' => 'input-field col s12 m4'],
'template' => '{input}{label}'])->input('checkbox');?>