src/Form/Contact/ContactType.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Form\Contact;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\FormBuilderInterface;
  5. use Symfony\Component\OptionsResolver\OptionsResolver;
  6. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  7. class ContactType extends AbstractType
  8. {
  9.     public function buildForm(FormBuilderInterface $builder, array $options)
  10.     {
  11.         $builder
  12.             ->add('name'null, [
  13.                 // 'label' => 'app.contact.form.name',
  14.                 'required' => true,
  15.                 'attr' => ['placeholder' => 'app.contact.form.name']
  16.             ])
  17.             ->add('contactEmail'null, [
  18.                 // 'label' => 'app.contact.form.email',
  19.                 'required' => true,
  20.                 'attr' => ['placeholder' => 'app.contact.form.email']
  21.             ])
  22.             ->add('contactPhone'null, [
  23.                 // 'label' => 'app.contact.form.phone',
  24.                 'required' => true,
  25.                 'attr' => ['placeholder' => 'app.contact.form.phone']
  26.             ])
  27.             ->add('subject'null, [
  28.                 // 'label' => 'app.contact.form.subject',
  29.                 'required' => true,
  30.                 'attr' => ['placeholder' => 'app.contact.form.subject']
  31.             ])
  32.             ->add('message'TextareaType::class, [
  33.                 // 'label' => 'app.contact.form.message',
  34.                 'required' => true,
  35.                 'attr' => ['placeholder' => 'app.contact.form.message']
  36.             ])
  37.         ;
  38.     }
  39.     public function configureOptions(OptionsResolver $resolver)
  40.     {
  41.         $resolver->setDefaults([
  42.             // Configure your form options here
  43.         ]);
  44.     }
  45. }