<?php
namespace App\Form;
use App\Entity\Comment;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\NotBlank;
class AddCommentMobileType extends AbstractType
{
public function __construct()
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('parent', HiddenType::class, [
'mapped' => false,
])
->add('content', TextType::class, [
'constraints' => [
new NotBlank(),
],
])
// ->add('recaptcha', EWZRecaptchaV3Type::class, [
// 'action_name' => 'add_comment_mobile',
// 'mapped' => false,
// 'constraints' => [
// new IsTrueV3()
// ]
// ])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => Comment::class,
]);
}
}