Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace tzfrsAppBundleFormType;
- use tzfrsAppBundleModelCar;
- use SymfonyComponentFormAbstractType;
- use SymfonyComponentFormExtensionCoreTypeChoiceType;
- use SymfonyComponentFormFormBuilderInterface;
- use SymfonyComponentOptionsResolverOptionsResolver;
- /**
- * Class CarType
- * @package tzfrsAppBundleFormType
- */
- class CarType extends AbstractType
- {
- /**
- * {@inheritdoc}
- */
- public function buildForm(FormBuilderInterface $builder, array $options)
- {
- $builder->add('specification', ChoiceType::class, [
- 'choices' => [1 => 1, 2 => 2, 3 => 3]
- ]);
- }
- /**
- * @inheritdoc
- */
- public function configureOptions(OptionsResolver $resolver)
- {
- $resolver->setDefaults([
- 'data_class' => Car::class
- ]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement