add( 'isVisible', CheckboxType::class, [ 'label' => 'Visible', 'required' => false, 'attr' => [ ], 'constraints' => [ ], ] ); $builder->add( 'priority', ChoiceType::class, [ 'label' => 'Priority', 'required' => true, 'attr' => [ ], 'choices' => call_user_func(function () { $choices = []; for ($u = 0; $u <= 10; ++$u) { $choices[$u] = $u / 10; } return $choices; }), 'constraints' => [ new NotBlank(), ], ] ); $builder->add( 'changeFrequency', ChoiceType::class, [ 'label' => 'Frequency of change', 'required' => true, 'attr' => [ ], 'choices' => [ 'Always' => 'always', 'Hourly' => 'hourly', 'Daily' => 'daily', 'Weekly' => 'weekly', 'Monthly' => 'monthly', 'Yearly' => 'yearly', 'Never' => 'never', ], 'constraints' => [ new NotBlank(), ], ] ); } public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ 'data_class' => null, ]); } }