0

일부 위젯이 포함 된 양식 유형 A가 있고 클래스 C1에 매핑되었습니다. 이 양식에 새 위젯이 필요합니다.이 위젯은이 클래스에 매핑되지 않습니다 (즉, 다른 클래스 C2에 매핑 됨). 그래서이 새로운 형태의 타입 B는 형태 A 형에 포함 된 새로운 형태의 유형 B.를 작성한symfony 2.5 폼 유효성 검사 오류

폼 타입 B : FormType B 포함

public function buildForm(FormBuilderInterface $builder, array $options) 
    { 
     $builder->add('join_event', 'date', array(
      'label' => 'employee.form.join_event.label', 
      'required' => true, 
      'widget' => 'single_text', 
      'attr' => array(
       'data-date-format' => 'MM-DD-YYYY' 
      ) 

     )); 
    } 

FormType A :

$builder->add('event', new FormTypeB(), array(
      'label' => false, 
      'mapped' => false 
)); 

양식 표시가 예상대로 잘되었지만 "이 값은 유효하지 않습니다"라는 메시지와 함께 제출시 유효성 검사 오류가 있습니다.

답변