<?php
declare(strict_types=1);
namespace App\Bundles\UserBundle\Form\Type\UserPassword;
use App\Bundles\UserBundle\DTO\ForgotPasswordDTO;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ForgotPasswordType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('email', EmailType::class, [
'translation_domain' => 'UserBundle',
'label' => 'user.email',
'required' => true,
'attr' => [
'placeholder' => 'user.email_placeholder',
'data-forgot-password-controller-target' => 'input',
'data-action' => 'input->forgot-password-controller#check',
],
])
->add('submit', SubmitType::class, [
'translation_domain' => 'UserBundle',
'label' => 'forms.forgot_password',
'attr' => [
'data-forgot-password-controller-target' => 'submitBtn',
],
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => ForgotPasswordDTO::class,
]);
}
}