0

我正在扩展这样的表单类:

 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 '标签更改为'开始日期' 总结:如何更改继承孩子的选项

4

0 回答 0