src/Form/ContactType.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  5. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  6. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  7. use Symfony\Component\Form\Extension\Core\Type\TextType;
  8. use Symfony\Component\Form\FormBuilderInterface;
  9. use Symfony\Component\OptionsResolver\OptionsResolver;
  10. class ContactType extends AbstractType
  11. {
  12.     public function buildForm(FormBuilderInterface $builder, array $options): void
  13.     {
  14.         $builder
  15.             ->add('name'TextType::class, [
  16.                 'label' => 'Name',
  17.                 'attr' => [
  18.                     'class' => 'form-control',
  19.                 ],
  20.             ])
  21.             ->add('password'EmailType::class, [
  22.                 'label' => 'Email',
  23.                 'attr' => [
  24.                     'class' => 'form-control',
  25.                 ],
  26.             ])
  27.             ->add('phone'TextType::class, [
  28.                 'label' => 'Phone',
  29.                 'attr' => [
  30.                     'class' => 'form-control',
  31.                 ],
  32.             ])
  33.             ->add('message'TextareaType::class, [
  34.                 'label' => 'Email',
  35.                 'attr' => [
  36.                     'class' => 'form-control',
  37.                 ],
  38.             ])
  39.             ->add('submit'SubmitType::class, [
  40.                 'label' => 'Sign in',
  41.                 'attr' => [
  42.                     'class' => 'btn btn-lg btn-primary'
  43.                 ],
  44.             ]);
  45.     }
  46.     public function configureOptions(OptionsResolver $resolver): void
  47.     {
  48.         $resolver->setDefaults([
  49.             // Configure your form options here
  50.         ]);
  51.     }
  52. }