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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -