src/Form/BuildingReportingFormType.php line 13
<?php
namespace App\Form;
use App\Entity\BuildingReportingHistory;
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\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class BuildingReportingFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('type', ChoiceType::class, [
'label' => 'Raison',
'choices' => [
'Photos' => 'Photos',
'Description' => 'Description',
],
'multiple' => false,
'attr' => [
'placeholder' => 'Raison',
'class' => ' block w-full my-2 px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm'
],
])
->add('number',NumberType::class,[
'label' => 'indiquez le numéro de la photo concernée par votre signalement',
'required' => false,
'attr' => [
'placeholder' => 'Nombre',
'class' => ' block w-full my-2 px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm'
],
])
->add('detail', TextareaType::class, [
'label' => 'Description',
'required' => false,
'attr' => [
'placeholder' => 'Description',
'class' => ' block w-full my-2 px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm'
],
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => BuildingReportingHistory::class,
]);
}
}