This commit is contained in:
2025-04-21 18:03:54 +02:00
parent f44b63a91f
commit 057bc778ed
9 changed files with 14 additions and 50 deletions

View File

@@ -9,6 +9,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/** @extends AbstractType<null> */
class EnterNameType extends AbstractType
{
public function __construct(private readonly TranslatorInterface $translator) {}

View File

@@ -9,16 +9,19 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Regex;
use Symfony\Contracts\Translation\TranslatorInterface;
/** @extends AbstractType<null> */
class SelectSeasonType extends AbstractType
{
public function __construct(private readonly TranslatorInterface $translator) {}
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('season_code', TextType::class,
['required' => true, 'constraints' => new Regex(pattern: "/^[A-Za-z\d]{5}$/")],
['required' => true, 'constraints' => new Regex(pattern: "/^[A-Za-z\d]{5}$/"), 'label' => $this->translator->trans('Season Code')]
)
// ->add('submit', SubmitType::class, ['label' => 'Start quiz'])
;
}