<?php
namespace App\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\FileType;
class PieceJointeType extends AbstractType
{
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'save_path' => 'uploads/',
]);
}
public function buildView(FormView $view, FormInterface $form, array $options): void
{
$view->vars['save_path'] = $options['save_path'];
}
public function getParent(): string
{
return FileType::class;
}
}