<?php
namespace App\Form;
use App\Entity\Contact;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
class ContactType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name', null, ['label' => false,'attr' => array('class' => 'form-control required')])
->add('email', null, ['label' => false,'attr' => array('class' => 'required email form-control')])
->add('phone', null, ['label' => false,'attr' => array('class' => 'form-control required')])
->add('subject', null, ['label' => false,'attr' => array('class' => 'form-control required')])
->add('message', TextareaType::class, ['label' => false,'attr' => array('class' => 'form-control required')])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Contact::class,
]);
}
}