48 lines
1.3 KiB
PHP
48 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Form;
|
|
|
|
use Symfony\Component\Form\AbstractType;
|
|
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
|
|
class AlertcategoryType extends AbstractType
|
|
{
|
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
|
{
|
|
$builder->add('submit',
|
|
SubmitType::class, [
|
|
'label' => 'Valider',
|
|
'attr' => ['class' => 'btn btn-success'],
|
|
]
|
|
);
|
|
|
|
$builder->add('label',
|
|
TextType::class, [
|
|
'label' => 'Label',
|
|
]
|
|
);
|
|
|
|
$builder->add('idicon', HiddenType::class, ['mapped' => false, 'data' => $options['idicon']]);
|
|
|
|
$builder->add('color', TextType::class, [
|
|
'label' => 'Couleur',
|
|
'required' => false,
|
|
'attr' => ['class' => 'pick-a-color'],
|
|
]);
|
|
}
|
|
|
|
public function configureOptions(OptionsResolver $resolver)
|
|
{
|
|
$resolver->setDefaults([
|
|
'data_class' => 'App\Entity\Alertcategory',
|
|
'mode' => 'string',
|
|
'idicon' => null,
|
|
'access' => 'string',
|
|
]);
|
|
}
|
|
}
|