src/Form/Type/FestivalSearchType.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Form\Type;
  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\DateType;
  7. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  8. use Symfony\Component\Form\Extension\Core\Type\TextType;
  9. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  10. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  11. class FestivalSearchType extends AbstractType
  12. {
  13.     public function buildForm(FormBuilderInterface $builder, array $options)
  14.     {
  15.         $builder
  16.             ->add('location'TextType::class, [
  17.                 'required' => false,
  18.             ])
  19.             ->add('locationhidden'HiddenType::class, [
  20.                 'required' => false,
  21.             ])
  22.             ->add('placeid'HiddenType::class, [
  23.                 'required' => false,
  24.             ])
  25.             ->add('date'DateType::class, [
  26.                 'required' => false,
  27.                 'html5' => false,
  28.                 'widget' => 'single_text',
  29.                 'input' => 'string',
  30.                 'input_format' => 'd/m/Y',
  31.                 'format' => 'dd/MM/yyyy',
  32.             ])
  33.             ->add('search'SubmitType::class, [
  34.                     'label' => 'Chercher' ])
  35.         ;
  36.     }
  37.     public function configureOptions(OptionsResolver $resolver)
  38.     {
  39.         $resolver->setDefaults([
  40.             // Configure your form options here
  41.         ]);
  42.     }
  43. }