src/Form/RegistrationFormType.php line 20

Open in your IDE?
  1. <?php
  2. /**
  3.  * @file
  4.  *   The registration form class.
  5.  */
  6. namespace App\Form;
  7. use Symfony\Component\Form\AbstractType;
  8. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  9. use Symfony\Component\Form\Extension\Core\Type\TextType;
  10. use Symfony\Component\Form\FormBuilderInterface;
  11. use Symfony\Component\OptionsResolver\OptionsResolver;
  12. use Symfony\Component\Validator\Constraints\Email;
  13. /**
  14.  * Registration Form.
  15.  */
  16. class RegistrationFormType extends AbstractType
  17. {
  18.     /**
  19.      * {@Inheritdoc}
  20.      */
  21.     public function buildForm(FormBuilderInterface $builder, array $options)
  22.     {
  23.         $builder
  24.             ->add('email_address'TextType::class, [
  25.                 'constraints' => new Email(),
  26.                 'label' => 'Email Address',
  27.             ])
  28.             ->add('submit'SubmitType::class, [
  29.                 'label' => "Register",
  30.             ]);
  31.     }
  32.     /**
  33.      * {@Inheritdoc}
  34.      */
  35.     public function configureOptions(OptionsResolver $resolver)
  36.     {
  37.         $resolver->setDefaults([
  38.             // Configure your form options here
  39.         ]);
  40.     }
  41. }