Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. class SurveyType extends AbstractType
  2. {
  3.     public function buildForm(FormBuilderInterface $builder, array $options)
  4.     {
  5.         $builder
  6.             ->add('title', TextareaType::class)
  7.             ->add('options', CollectionType::class, [
  8.                 'entry_type' => SurveyOptionType::class,
  9.                 'entry_options' => ['label' => false],
  10.                 'allow_add' => true,
  11.                 'by_reference' => false,
  12.             ])
  13.             ->add('save', SubmitType::class, ['label' => 'Submit'])
  14.         ;
  15.     }
  16.  
  17.     public function configureOptions(OptionsResolver $resolver)
  18.     {
  19.         $resolver->setDefaults([
  20.             'data_class' => Survey::class,
  21.         ]);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement