src/Form/AddCommentMobileType.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\Comment;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  6. use Symfony\Component\Form\Extension\Core\Type\TextType;
  7. use Symfony\Component\Form\FormBuilderInterface;
  8. use Symfony\Component\OptionsResolver\OptionsResolver;
  9. use Symfony\Component\Validator\Constraints\NotBlank;
  10. class AddCommentMobileType extends AbstractType
  11. {
  12.     public function __construct()
  13.     {
  14.     }
  15.     public function buildForm(FormBuilderInterface $builder, array $options)
  16.     {
  17.         $builder
  18.             ->add('parent'HiddenType::class, [
  19.                 'mapped' => false,
  20.             ])
  21.             ->add('content'TextType::class, [
  22.                 'constraints' => [
  23.                     new NotBlank(),
  24.                 ],
  25.             ])
  26. //            ->add('recaptcha', EWZRecaptchaV3Type::class, [
  27. //                'action_name' => 'add_comment_mobile',
  28. //                'mapped' => false,
  29. //                'constraints' => [
  30. //                    new IsTrueV3()
  31. //                ]
  32. //            ])
  33.         ;
  34.     }
  35.     public function configureOptions(OptionsResolver $resolver)
  36.     {
  37.         $resolver->setDefaults([
  38.             'data_class' => Comment::class,
  39.         ]);
  40.     }
  41. }