field($model, 'field_name')->checkbox(); ActiveForm::end(); ?>
1]); ?>This example demonstrates a simple use case for Html activeCheckbox, taking the model attribute 'attribute_name' and setting it to a value of 1. This will create a checkbox form element with the label 'attribute_name', which will be checked by default. Package Library: This function is part of the yii\helpers package within the Yii PHP framework, which provides a collection of utility/helper functions for working with HTML, URLs, string manipulation, arrays, and other common programming tasks.