<?php
namespace App\Form;
// Voir https://symfony.com/doc/current/reference/forms/types.html
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\Extension\Core\Type\BirthdayType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Translation\TranslatorInterface;
class Concours2023FormType extends AbstractType
{
/**
* @inheritDoc
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
/*
* Si vous créez un formulaire en "dur" dans votre vue (ex: demo-contact-sans-formbuilder.html.php),
* alors vous pouvez laisser les lignes ci-dessous en commentaire.
* Si vous créez un formulaire avec le formbuilder dans votre vue (ex: demo-contact-avec-formbuilder.html.php),
* alors décommentez les lignes ci-dessous et créez vos propres champs.
*/
$builder
->add('lastname', TextType::class, [
'label' => 'Nom',
'required' => true,
'attr' => [
'class' => 'uk-form-controls uk-input input-style'
]
])
->add('firstname', TextType::class, [
'label' => 'Prénom',
'required' => true,
'attr' => [
'class' => 'uk-form-controls uk-input input-style'
]
])
->add('email', EmailType::class, [
'label' => 'Email',
'required' => true,
'attr' => [
'class' => 'uk-form-controls uk-input input-style'
]
])
->add('choixmultiple', ChoiceType::class, [
'label' => 'En tennis, que signifie « faire le break » ?',
'multiple' => false,
'expanded' => true,
'required' => true,
'choices' => [
'Faire une pause pour boire un coup' => 'Concours2023Reponse1',
'Gagner le jeu alors que l’adversaire est au service' => 'Concours2023Reponse2',
'Faire une petite chorégraphie de danse' => 'Concours2023Reponse3'
]
])
->add('message', TextType::class, [
'label' => 'Réponse ouverte',
'required' => true,
'attr' => [
'class' => 'uk-form-controls uk-input input-style'
]
])
->add('reglement', CheckboxType::class, [
'label' => true,
'required' => true,
'attr' => ['class' => 'uk-checkbox checkbox-style'],
])
->add('gdpr', CheckboxType::class, [
'label' => true,
'required' => true,
'attr' => ['class' => 'uk-checkbox checkbox-style'],
])
->add('preuvePaiement', FileType::class, [
'label' => 'Veuillez insérer votre preuve d\'achat',
'required' => true,
'attr' => [
'class' => 'dropify',
'data-allowed-file-extensions' => 'jpg jpeg png pdf hec heic heif'
],
])
->add('recaptcha', HiddenType::class, [
'attr' => [
'class' => 'gs-recaptcha'
],
'required' => false
])
->add('submit', SubmitType::class, [
'label' => 'Participer',
'attr' => [
'class' => 'uk-button uk-button-tertiary'
]
]);
}
/**
* @inheritDoc
*/
public function configureOptions(OptionsResolver $resolver)
{
}
}