Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SurveyType extends AbstractType
- {
- public function buildForm(FormBuilderInterface $builder, array $options)
- {
- $builder
- ->add('title', TextareaType::class)
- ->add('options', CollectionType::class, [
- 'entry_type' => SurveyOptionType::class,
- 'entry_options' => ['label' => false],
- 'allow_add' => true,
- 'by_reference' => false,
- ])
- ->add('save', SubmitType::class, ['label' => 'Submit'])
- ;
- }
- public function configureOptions(OptionsResolver $resolver)
- {
- $resolver->setDefaults([
- 'data_class' => Survey::class,
- ]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement