<?php
namespace App\Form;
use App\Data\SearchData;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class SearchForm extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('largeur', ChoiceType::class, [
'choices' => [
'135' => '135',
'145' => '145',
'155' => '155',
'165' => '165',
'175' => '175',
'185' => '185',
'195' => '195',
'205' => '205',
'215' => '215',
'225' => '225',
'235' => '235',
'245' => '245',
'255' => '255',
'265' => '265',
'275' => '275',
'285' => '285',
'295' => '295',
'305' => '305',
'315' => '315',
],
'label' => false,
'placeholder' => 'Toutes les largeurs',
'required' => true,
'data' => "205",
])
->add('hauteur', ChoiceType::class, [
'choices' => [
'30' => '30',
'35' => '35',
'40' => '40',
'45' => '45',
'50' => '50',
'55' => '55',
'60' => '60',
'65' => '65',
'70' => '70',
'75' => '75',
'80' => '80',
'85' => '85',
'90' => '90',
],
'label' => false,
'placeholder' => 'Toutes les hauteurs',
'required' => true,
'data' => "55",
])
->add('marque', ChoiceType::class, [
'choices' => [
'Toutes les marques' => '',
'Premium' => [
'Bridgestone' => 'Bridgestone',
'Continental' => 'Continental',
'Dunlop' => 'Dunlop',
'Goodyear' => 'Goodyear',
'Hankook' => 'Hankook',
'Michelin' => 'Michelin',
'Pirelli' => 'Pirelli',
],
'Qualité' => [
'Falken' => 'Falken',
'Firestone' => 'Firestone',
'Fulda' => 'Fulda',
'Kleber' => 'Kleber',
'Kumho' => 'Kumho',
'Laufenn' => 'Laufenn',
'Maxxis' => 'Maxxis',
'Nokian' => 'Nokian',
'Nexen' => 'Nexen',
'Riken' => 'Riken',
'Toyo' => 'Toyo',
'Uniroyal' => 'Uniroyal',
'Yokohama' => 'Yokohama',
],
'Budget' => [
'Aplus' => 'Aplus',
'Austone' => 'Austone',
'Autogreen' => 'Autogreen',
'Compasal' => 'Compasal',
'CST' => 'CST',
'Dayton' => 'Dayton',
'Debica' => 'Debica',
'Evergreen' => 'Evergreen',
'Firemax' => 'Firemax',
'Fortuna' => 'Fortuna',
'Goodride' => 'Goodride',
'Gremax' => 'Gremax',
'Haida' => 'Haida',
'Headway' => 'Headway',
'Hifly' => 'Hifly',
'Infinity' => 'Infinity',
'Insa Turbo' => 'Insa Turbo',
'Landsail' => 'Landsail',
'Lanvigator' => 'Lanvigator',
'Leao' => 'Leao',
'Leonard' => 'Leonard',
'Linglong' => 'Linglong',
'Maxtrek' => 'Maxtrek',
'Mazzini' => 'Mazzini',
'Nankang' => 'Nankang',
'Ovation' => 'Ovation',
'Powertrac' => 'Powertrac',
'Roadstone' => 'Roadstone',
'Rovela' => 'Rovela',
'Sailun' => 'Sailun',
'Sava' => 'Sava',
'Starmaxx' => 'Starmaxx',
'Superia' => 'Superia',
'Tomket' => 'Tomket',
'Tracmax' => 'Tracmax',
'Trazano' => 'Trazano',
'Wanli' => 'Wanli',
'Westlake' => 'Westlake',
'Zeetex' => 'Zeetex',
],
],
'label' => false,
'placeholder' => 'Toutes les marques',
'required' => false,
])
->add('vitesse', ChoiceType::class, [
'choices' => [
'Q < 160 km/h' => 'Q < 160 km/h',
'R < 170 km/h' => 'R < 170 km/h',
'S < 180 km/h' => 'S < 180 km/h',
'U < 200 km/h' => 'U < 200 km/h',
'T < 190 km/h' => 'T < 190 km/h',
'H < 210 km/h' => 'H < 210 km/h',
'V < 240 km/h' => 'V < 240 km/h',
'W < 270 km/h' => 'W < 270 km/h',
],
'label' => false,
'placeholder' => 'Toutes les vitesses',
'required' => false,
'data' => "V < 240 km/h",
])
->add('diametre', ChoiceType::class, [
'choices' => [
"12" => "12",
"13" => "13",
"14" => "14",
"15" => "15",
"16" => "16",
"17" => "17",
"18" => "18",
"19" => "19",
"20" => "20",
"21" => "21",
"22" => "22",
],
'label' => false,
'placeholder' => 'Toutes les diametres',
'required' => true,
'data' => "16",
])
->add('charge', ChoiceType::class, [
'choices' => [
"60" => "60",
"61" => "61",
"62" => "62",
"63" => "63",
"64" => "64",
"65" => "65",
"66" => "66",
"67" => "67",
"68" => "68",
"69" => "69",
"70" => "70",
"71" => "71",
"72" => "72",
"73" => "73",
"74" => "74",
"75" => "75",
"76" => "76",
"77" => "77",
"78" => "78",
"79" => "79",
"80" => "80",
"81" => "81",
"82" => "82",
"83" => "83",
"84" => "84",
"85" => "85",
"86" => "86",
"87" => "87",
"88" => "88",
"89" => "89",
"90" => "90",
"91" => "91",
"92" => "92",
"93" => "93",
"94" => "94",
"95" => "95",
"96" => "96",
"97" => "97",
"98" => "98",
"99" => "99",
"100" => "100",
"101" => "101",
"102" => "102",
"103" => "103",
"104" => "104",
"105" => "105",
"106" => "106",
"107" => "107",
"108" => "108",
"109" => "109",
"110" => "110",
"111" => "111",
"112" => "112",
"113" => "113",
"114" => "114",
"115" => "115",
"116" => "116",
"117" => "117",
"118" => "118",
"119" => "119",
],
'label' => false,
'placeholder' => 'Toutes les charges',
'required' => false,
'data' => "91",
])
->add('saison', ChoiceType::class, [
'choices' => [
"Été" => "Été",
"Hiver" => "Hiver",
"4 saisons" => "4 saisons",
],
'label' => false,
'placeholder' => 'Toutes les saisons',
'required' => false,
'data' => "Été",
])
->add('specificite', ChoiceType::class, [
'choices' => [
"Renforcé" => "Renforcé",
"Runflat" => "Runflat",
"Silent" => "Silent",
], 'placeholder' => '------------------',
'label' => false,
'placeholder' => 'Aucune',
'required' => false,
])
// ->add('categories', EntityType::class, array(
// 'class' => Category::class,
// 'choice_label' => 'name',
// 'label' => false,
// 'placeholder' => 'All categories',
// 'required' => false,
// 'choice_translation_domain' => 'messages',
// ))
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => SearchData::class,
'method' => 'GET',
'csrf_protection' => false,
]);
}
public function getBlockPrefix()
{
return '';
}
}