<?php
namespace App\Form;
use App\Entity\AnnonceSearch;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class AnnonceSearchType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('minsurface', IntegerType::class, [
'required' => false,
'label' => false,
'attr' => [
'placeholder' => 'Surface minimal'
]
])
->add('maxprice', IntegerType::class, [
'required' => false,
'label' => false,
'attr' => [
'placeholder' => 'Budget max'
]
])
->add('nbchambre', IntegerType::class, [
'required' => false,
'label' => false,
'attr' => [
'placeholder' => 'Nombre chambre'
]
]);
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => AnnonceSearch::class,
'method' => 'get',
'csrf_protection' => false
]);
}
public function getBlockPrefix()
{
return '';
}
}