<?php

namespace App\Form;

use App\Entity\CarteFractal;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Vich\UploaderBundle\Form\Type\VichImageType;

class CarteFractalType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('type')
            ->add('imageFile',VichImageType::class,[
                'label' => 'Image de la carte',

            ])
            ->add('description')
            ->add('prix')
            ->add('date')
            ->add('classeurFractal', null, [
                'disabled'   => true,
        ])
        ;
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults([
            'data_class' => CarteFractal::class,
        ]);
    }
}
