[英]Cant assign CSS class in FormType Symfony2
I installed bootstrap via bundle in Symfony2. 我在Symfony2中通过捆绑包安装了引导程序。 But now I getting the some strange situation, when I append the class selcetor to form field of date type.
但是现在,当我将类选择器追加到日期类型的字段中时,出现了一些奇怪的情况。 In output I getting it with bootstrap-date class, and I cant change it.
在输出中,我使用bootstrap-date类获取了它,并且无法更改它。 So where is the my problem?
那么我的问题在哪里呢? Thanks!
谢谢! Here is the FormType code:
这是FormType代码:
->add('startDate', 'date', [
'label' => 'Start date',
'attr' => [
'class' => 'advanced_search_form',
],
])
Here is HTML: 这是HTML:
您可以从树枝模板执行此操作:
{{ form_widget(form.startDate, { 'attr': {'class': 'advanced_search_form'} }) }}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.