<?php
namespace App\Form\Type;
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\Contracts\Translation\TranslatorInterface;
class EmailRecoverPasswordType extends AbstractType
{
private $translator;
public function __construct(
TranslatorInterface $translator
) {
$this->translator = $translator;
}
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('email', EmailType::class, [
'required' => true,
'label' => $this->translator->trans('pages.recover_password.email_label'),
'attr' => ['class' => 'form-control', 'required' => ''],
])
->add('save', SubmitType::class, [
'label' => $this->translator->trans('pages.recover_password.button'),
])
;
}
}