symfony - How to specify Symfony2 Bootstrap checkbox inline style? -
the symfony2 boostrap template has conditional switch on 'checkbox-inline'. how triggered?
{% if 'checkbox-inline' in parent_label_class %} {{- form_label(form, null, { widget: parent() }) -}}
since conditional check looking in parent_label_class
, can add form builder option called label_attr
, , there can append class.
example:
$builder->add('checkbox', 'checkbox', array( 'label_attr' => array( 'class' => 'checkbox-inline' ) ) );
which give following output:
<div class="checkbox"> <label class="checkbox-inline required"> <input type="checkbox" id="form_checkbox" name="form[checkbox]" required="required" value="1" />checkbox </label> </div>
Comments
Post a Comment