src/Form/AffichageGraphiqueType.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\DTO\AffichageGraphiqueDTO;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  6. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  7. use Symfony\Component\Form\FormBuilderInterface;
  8. use Symfony\Component\OptionsResolver\OptionsResolver;
  9. class AffichageGraphiqueType extends AbstractType {
  10.     public static $USAGE_LOGEMENT = 'logement';
  11.     public static $USAGE_TERTIAIRE = 'tertiaire';
  12.     
  13.     public function buildForm(FormBuilderInterface $builder, array $options) {
  14.         $builder
  15.                 ->add('usage', ChoiceType::class, [
  16.                     'placeholder' => 'Tous',
  17.                     'choices' => ['logement' => 'logement', 'tertiaire' => 'tertiaire']
  18.                 ])
  19.                 ->add('zoneClimatique', ChoiceType::class, [
  20.                     'placeholder' => 'Tous',
  21.                     'choices' => ['H1' => 'H1', 'H2' => 'H2', 'H3' => 'H3']
  22.                 ])
  23.                 ->add('abscisse', ChoiceType::class, [
  24.                     'choices' => ['Compacité' => 'compacite', 'Taux vitré' => 'tauxVitre', 'Compacité et Taux vitré' => 'compaciteVitre','Compacité, taux vitré et brassage' => 'compaciteVitreBrassage', '% d\'orientation sud' => 'orientationSud']
  25.                 ])
  26.                 ->add('ordonnee', ChoiceType::class, [
  27.                     'choices' => ['BBIO chauffage' => 'bBioChauffage', 'BBIO eclairage' => 'bBioEclairage']
  28.                 ])
  29.         ;
  30.     }
  31.     public function configureOptions(OptionsResolver $resolver) {
  32.         $resolver->setDefaults([
  33.             'data_class' => AffichageGraphiqueDTO::class,
  34.         ]);
  35.     }
  36. }