We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Syntax: checkbox(string $name, string $default=0, array $args=array(), string $tpl=null)
checkbox(string $name, string $default=0, array $args=array(), string $tpl=null)
A standard checkbox will pass either a 1 or 0 value:
<?php Form::checkbox('mycheckbox', 1); ?>
If you want to pass values other than 1 and 0, then pass "checked_value" and "unchecked_value" as arguments:
<?php Form::checkbox('mycheckbox', 'Yes', array('checked_value'=>'Yes','unchecked_value'=>'No')); ?>
Checkbox fields pair a hidden field with a checkbox field to support the unchecked and checked value, respectively.
Home