src/Form/MessageType.php line 12
<?php
namespace App\Form;
use App\Entity\Message;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
class MessageType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('Nom', TextType::class, ['attr' => ['placeholder' => 'Nom & Prénom']])
->add('Email', TextType::class, ['attr' => ['placeholder' => 'Email']])
->add('Objet', TextType::class, ['attr' => ['placeholder' => 'Objet']])
->add('Message', TextareaType::class, ['attr' => ['placeholder' => 'Message']])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => Message::class,
]);
}
}