How to set a class attribute to a Symfony2 form input

前端 未结 8 1897
生来不讨喜
生来不讨喜 2020-11-29 23:27

How can I set the HTML class attribute to a form using the FormBuilder in Symfony2 ?

S

8条回答
  •  再見小時候
    2020-11-30 00:22

    You can do it with FormBuilder. Add this to the array in your FormBuilder:

    'attr'=> array('class'=>'span2')
    

提交回复
热议问题