Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?php
  2. namespace tzfrsAppBundleFormType;
  3.  
  4. use tzfrsAppBundleModelCar;
  5. use SymfonyComponentFormAbstractType;
  6. use SymfonyComponentFormExtensionCoreTypeChoiceType;
  7. use SymfonyComponentFormFormBuilderInterface;
  8. use SymfonyComponentOptionsResolverOptionsResolver;
  9.  
  10. /**
  11. * Class CarType
  12. * @package tzfrsAppBundleFormType
  13. */
  14. class CarType extends AbstractType
  15. {
  16. /**
  17. * {@inheritdoc}
  18. */
  19. public function buildForm(FormBuilderInterface $builder, array $options)
  20. {
  21. $builder->add('specification', ChoiceType::class, [
  22. 'choices' => [1 => 1, 2 => 2, 3 => 3]
  23. ]);
  24. }
  25.  
  26. /**
  27. * @inheritdoc
  28. */
  29. public function configureOptions(OptionsResolver $resolver)
  30. {
  31. $resolver->setDefaults([
  32. 'data_class' => Car::class
  33. ]);
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement