src/Form/AskRecoveryType.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  5. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  6. use Symfony\Component\Form\FormBuilderInterface;
  7. use Symfony\Component\OptionsResolver\OptionsResolver;
  8. class AskRecoveryType extends AbstractType
  9. {
  10.     public function configureOptions(OptionsResolver $resolver)
  11.     {
  12.         $resolver->setDefaults([
  13.             'data_class' => null,
  14.             'translation_domain' => 'form'
  15.         ]);
  16.     }
  17.     public function buildForm(FormBuilderInterface $builder, array $options)
  18.     {
  19.         $builder
  20.             ->add('email'EmailType::class, [
  21.                 'required' => true,
  22.                 'label_attr' => [
  23.                     'class' => 'sr-only',
  24.                 ],
  25.                 'attr' => [
  26.                     'placeholder' => 'Email',
  27.                     'class' => 'recover-email',
  28.                 ],
  29.             ])
  30.             ->add('submit'SubmitType::class, [
  31.                 'attr' => [
  32.                     'class' => 'btn-lg btn-primary btn-block',
  33.                 ],
  34.             ])
  35.         ;
  36.     }
  37. }