<?php
namespace App\Form\Type\Frontend;
use App\Form\Type\EWZRecaptchaCustomType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\Email;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
class RecruitmentApplyType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('lastName', TextType::class, [
'label' => 'frontend.wiki.recruitment_apply.last_name',
'constraints' => [
new NotBlank(),
new Length(['min' => 3]),
],
])
->add('firstName', TextType::class, [
'label' => 'frontend.wiki.recruitment_apply.first_name',
'constraints' => [
new NotBlank(),
new Length(['min' => 3]),
],
])
->add('email', EmailType::class, [
'label' => 'frontend.wiki.recruitment_apply.email',
'constraints' => [
new NotBlank(),
new Email(),
],
])
->add('job', TextType::class, [
'label' => 'frontend.wiki.recruitment_apply.job',
'constraints' => [
new NotBlank(),
new Length(['min' => 3]),
],
])
->add('message', TextareaType::class, [
'label' => 'frontend.wiki.recruitment_apply.message',
'required' => true,
])
->add('cv', FileType::class, [
'required' => true,
'label' => 'frontend.wiki.recruitment_apply.cv',
'attr' => [
'accept' => 'application/pdf',
'class' => 'input-file-recruitment',
],
])
->add('coverLetter', FileType::class, [
'required' => false,
'label' => 'frontend.wiki.recruitment_apply.coverLetter',
'attr' => [
'accept' => 'application/pdf',
'class' => 'input-file-recruitment',
],
])
->add('recaptcha', EWZRecaptchaCustomType::class);
}
public function getBlockPrefix(): string
{
return 'vp_auto_frontend_recruitment_apply';
}
}