src/Forms/Frontend/QuoteForm.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Forms\Frontend;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\FormBuilderInterface;
  5. use Symfony\Component\Form\Extension\Core\Type;
  6. use Symfony\Bridge\Doctrine\Form\Type\EntityType;
  7. use Symfony\Component\OptionsResolver\OptionsResolver;
  8. class QuoteForm extends AbstractType
  9. {
  10.     public function buildForm(FormBuilderInterface $builder, array $options)
  11.     {
  12.         $builder
  13.             ->add('name'Type\TextType::class)
  14.             ->add('email'Type\EmailType::class)
  15.             ->add('collectionPostcode'Type\TextType::class, array(
  16.                 'label' => "Collection postcode",
  17.             ))
  18.             ->add('deliveryAddress'Type\TextType::class, array(
  19.                 'label' => "Delivery postcode",
  20.             ))
  21.             ->add('descriptionOfGoods'Type\ChoiceType::class, array(
  22.                 'label' => "Description of goods",
  23.                 'choices' => array(
  24.                     'Envelope' => 'Envelope',
  25.                     'Box' => 'Box',
  26.                     'Pallet' => 'Pallet',
  27.                     'Other' => 'Other',
  28.                 )
  29.             ))
  30.             ->add('serviceRequired'Type\ChoiceType::class, array(
  31.                 'label' => "Service required",
  32.                 'choices' => array(
  33.                     'Same Day' => 'Same Day',
  34.                     'Next Day' => 'Next Day',
  35.                     'International' => 'International'
  36.                 )
  37.             ))
  38.             ->add('quoteType'Type\ChoiceType::class, array(
  39.                 'label' => "Quote type",
  40.                 'choices' => array(
  41.                     'Quote Request' => 'Quote Request',
  42.                     'Online Booking' => 'Online Booking'
  43.                 )
  44.             ))
  45.             ->add('save'Type\SubmitType::class, array(
  46.                 'label' => "Submit",
  47.                 'attr' => array(
  48.                     'class' => 'btn btn-primary'
  49.                 )
  50.             ));
  51.     }
  52. }