src/Form/Type/EmailRecoverPasswordType.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Form\Type;
  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\Contracts\Translation\TranslatorInterface;
  8. class EmailRecoverPasswordType extends AbstractType
  9. {
  10.     private $translator;
  11.     public function __construct(
  12.         TranslatorInterface $translator
  13.     ) {
  14.         $this->translator $translator;
  15.     }
  16.     public function buildForm(FormBuilderInterface $builder, array $options): void
  17.     {
  18.         $builder
  19.             ->add('email'EmailType::class, [
  20.                 'required' => true,
  21.                 'label' => $this->translator->trans('pages.recover_password.email_label'),
  22.                 'attr' => ['class' => 'form-control''required' => ''],
  23.             ])
  24.             ->add('save'SubmitType::class, [
  25.                 'label' => $this->translator->trans('pages.recover_password.button'),
  26.             ])
  27.         ;
  28.     }
  29. }