src/Model/Form/ResetPasswordForm.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Model\Form;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  5. use Symfony\Component\Form\FormBuilderInterface;
  6. use Symfony\Component\Validator\Constraints\NotBlank;
  7. /**
  8.  * Class ResetPasswordForm.
  9.  */
  10. class ResetPasswordForm extends AbstractType
  11. {
  12.     /**
  13.      * {@inheritdoc}
  14.      */
  15.     public function buildForm(FormBuilderInterface $builder, array $options)
  16.     {
  17.         parent::buildForm($builder$options);
  18.         $builder->add('email'EmailType::class, [
  19.             'label' => 'Email',
  20.             'required' => true,
  21.             'constraints' => [
  22.                     new NotBlank(['message' => 'Email should not be empty.'])
  23.                 ]
  24.         ]);
  25.     }
  26.     /**
  27.      * Returns the name of this type.
  28.      *
  29.      * @return string The name of this type
  30.      */
  31.     public function getName()
  32.     {
  33.         return 'reset_password';
  34.     }
  35. }