src/Form/NeedHelpFormType.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use Karser\Recaptcha3Bundle\Form\Recaptcha3Type;
  4. use Karser\Recaptcha3Bundle\Validator\Constraints\Recaptcha3;
  5. use Symfony\Component\Form\AbstractType;
  6. use Symfony\Component\Form\Extension\Core\Type\ButtonType;
  7. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  8. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  9. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  10. use Symfony\Component\Form\Extension\Core\Type\TextType;
  11. use Symfony\Component\Form\FormBuilderInterface;
  12. class NeedHelpFormType extends AbstractType
  13. {
  14.     public function buildForm(FormBuilderInterface $builder, array $options)
  15.     {
  16.         $builder
  17.             ->add('name'TextType::class, [
  18.                 'attr' => array(
  19.                     'class' => 'form-control'
  20.                 ),
  21.                 'required' => true,
  22.                 'label' => 'Your Name*',
  23.             ])
  24.             ->add('email'EmailType::class, [
  25.                 'required' => true,
  26.                 'label' => 'Your Email*',
  27.             ])
  28.             ->add('company'TextType::class, [
  29.                 'attr' => array(
  30.                     'class' => 'form-control'
  31.                 ),
  32.                 'required' => true,
  33.                 'label' => 'Company*',
  34.             ])
  35.             ->add('username'TextType::class, [
  36.                 'attr' => array(
  37.                     'class' => 'form-control'
  38.                 ),
  39.                 'required' => false,
  40.                 'label' => 'Your HMSDC eXchange Username',
  41.             ])
  42.             ->add('message'TextareaType::class, [
  43.                 'attr' => array(
  44.                     'class' => 'form-control'
  45.                 ),
  46.                 'required' => true,
  47.                 'label' => 'Message*',
  48.             ])
  49.             ->add('captcha'Recaptcha3Type::class, [
  50.                 'constraints' => new Recaptcha3(),
  51.                 'action_name' => 'homepage',
  52. //                'script_nonce_csp' => $nonceCSP,
  53.                 'locale' => 'de',
  54.             ])
  55.             ->add('submit'SubmitType::class, [
  56.                 'attr' => [
  57.                     'class' => 'btn-primary'
  58.                 ]
  59.             ]);
  60.     }
  61. }