Symfony 2:扩展表单类:更改继承子项的标签

时间:2013-04-03 12:06:48

标签: symfony symfony-2.1 symfony-forms

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

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

0 个答案:

没有答案