[英]How to set attributes for form field rendered by two inputs in Symfony2
I have date field in symfony2 which is rendered by two inputs: 我在symfony2中有date字段,它由两个输入呈现:
$builder
->add('timeStart','datetime',array(
'date_widget' => 'single_text',
'time_widget' => 'single_text',
'date_format' => 'yyyy-MM-dd',
'data' => new \DateTime('now')
))
how to set attributes for each input? 如何为每个输入设置属性? When I add attr=>array('some_attr'=>'some_value')
it is added to the div in which those inputs are, not to each input. 当我添加attr=>array('some_attr'=>'some_value')
它会添加到这些输入所在的div中,而不是每个输入中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.