src/Form/UserRegistrationForm.php line 34

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\Agency;
  4. use App\Entity\User;
  5. use App\Form\DataTransformer\RoleTransformer;
  6. use Doctrine\ORM\EntityManager;
  7. use Symfony\Bridge\Doctrine\Form\Type\EntityType;
  8. use Symfony\Component\Form\AbstractType;
  9. use Symfony\Component\Form\ChoiceList\View\ChoiceView;
  10. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  11. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  12. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  13. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  14. use Symfony\Component\Form\Extension\Core\Type\PasswordType;
  15. use Symfony\Component\Form\Extension\Core\Type\RadioType;
  16. use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
  17. use Symfony\Component\Form\Extension\Core\Type\TextType;
  18. use Symfony\Component\Form\Extension\Core\Type\UrlType;
  19. use Symfony\Component\Form\FormBuilderInterface;
  20. use Symfony\Component\Form\FormEvent;
  21. use Symfony\Component\Form\FormEvents;
  22. use Symfony\Component\Form\FormInterface;
  23. use Symfony\Component\Form\FormView;
  24. use Symfony\Component\OptionsResolver\OptionsResolver;
  25. use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
  26. use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
  27. use Symfony\Component\Translation\TranslatorInterface;
  28. use Symfony\Component\Validator\Constraints as Assert;
  29. class UserRegistrationForm extends AbstractType
  30. {
  31.     /**
  32.      * @param FormBuilderInterface $builder
  33.      * @param array $options
  34.      */
  35.     public function buildForm(FormBuilderInterface $builder, array $options)
  36.     {
  37.         $builder
  38.             ->add('email'EmailType::class,[
  39.                 'attr' => ['autocomplete'=>'off']
  40.             ])
  41.             ->add('plainPassword'PasswordType::class,[
  42.                 'attr' => ['autocomplete'=>'off','data-type'=>'password']
  43.             ]);
  44.     }
  45.     /**
  46.      * @param OptionsResolver $resolver
  47.      */
  48.     public function configureOptions(OptionsResolver $resolver)
  49.     {
  50.         $resolver->setDefaults([
  51.             'data_class' => User::class,
  52.         ]);
  53.     }
  54. }