我正在扩展这样的表单类:
class RepportDateType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('test_date', 'date',array('constraints' => array(
new NotBlank()),'label'=>'Date','widget'=>'single_text','format' => 'dd-MM-yyyy','input'=>'datetime'))
;
}
}
class IncidentReportType extends RepportDateType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
parent::buildForm($builder, $options);
$builder
->add('end_date', 'date',array('constraints' => array(
new NotBlank()),'label'=>'Date de fin','widget'=>'single_text','format' => 'dd-MM-yyyy','input'=>'datetime'))
;
}
public function getName()
{
return 'incident_repport_date';
}
}
我的问题是,我希望将父母的表单子项“ test_date ”更改为'开始日期' 总结一下:如何更改继承子项的选项