<?php

namespace App\Form;

use App\Entity\Formules;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class FormulesType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
       $builder
           ->add('name',TextType::class,[
               'label' => 'Nom de la formule',
           ])
           ->add('description',TextareaType::class,[
               'label' => 'Description de la formule',
           ])
           ->add('imageFile',FileType::class,[
               'label' => 'Image de la formule',
               'required' => false,
           ])
       ;
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
            $resolver->setDefault('data_class',Formules::class);
        }
}
