src/Form/AnnonceSearchType.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\AnnonceSearch;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\Extension\Core\Type\IntegerType;
  6. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  7. use Symfony\Component\Form\FormBuilderInterface;
  8. use Symfony\Component\OptionsResolver\OptionsResolver;
  9. class AnnonceSearchType extends AbstractType
  10. {
  11.     public function buildForm(FormBuilderInterface $builder, array $options): void
  12.     {
  13.         $builder
  14.             ->add('minsurface'IntegerType::class, [
  15.                 'required' => false,
  16.                 'label' => false,
  17.                 'attr' => [
  18.                     'placeholder' => 'Surface minimal'
  19.                 ]
  20.             ])
  21.             ->add('maxprice'IntegerType::class, [
  22.                 'required' => false,
  23.                 'label' => false,
  24.                 'attr' => [
  25.                     'placeholder' => 'Budget max'
  26.                 ]
  27.             ])
  28.             ->add('nbchambre'IntegerType::class, [
  29.                 'required' => false,
  30.                 'label' => false,
  31.                 'attr' => [
  32.                     'placeholder' => 'Nombre chambre'
  33.                 ]
  34.             ]);
  35.     }
  36.     public function configureOptions(OptionsResolver $resolver): void
  37.     {
  38.         $resolver->setDefaults([
  39.             'data_class' => AnnonceSearch::class,
  40.             'method' => 'get',
  41.             'csrf_protection' => false
  42.         ]);
  43.     }
  44.     public function getBlockPrefix()
  45.     {
  46.         return '';
  47.     }
  48. }