Form Checkboxes & Radios
Radio and Checkbox modules allow you to simply wrap them into a label, and provide some extra methods
Wrap a checkbox into a
The
label
.The
label()
method accepts html attributes as second arg. If the input attrs contains an id
key, the for
label attribute will be set:
Form::checkbox('name', '', null, array('label' => 'My fist checkbox')) // or Form::checkbox('name', '', null, array('id' => 'first'))->label("Checkbox")
Provide the
inline
key or method to display multiples radios / checkboxes. The inline method /arg act as label
:
Form::radio('name', true, array('inline' => 'First radio')) Form::radio('name')->inline('Second radio')
The
checked()
method:
Form::radio('name')->label('Radio 2')->checked();
The
disabled
state accepts boolean. The muted
css class is added by default:
Form::checkbox('name', '', true)->label('Checkbox 2')->disabled();