src/Form/Type/SubscribeType.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Form\Type;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\FormBuilderInterface;
  5. use Symfony\Component\OptionsResolver\OptionsResolver;
  6. use Symfony\Component\Form\Extension\Core\Type\DateType;
  7. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  8. use Symfony\Component\Form\Extension\Core\Type\TextType;
  9. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  10. class SubscribeType extends AbstractType
  11. {
  12.     public function buildForm(FormBuilderInterface $builder, array $options)
  13.     {
  14.         $builder
  15.             ->add('subscription'HiddenType::class, [
  16.                 'attr'=> [ 
  17.                     'value' => 'subscribe',
  18.                 ],
  19.             ])
  20.             ->add('sumbit'SubmitType::class, [
  21.                 'icon' => 'fas fa-heart',
  22.                 'label' => 'S\'abonner',
  23.                 'attr'=> [ 
  24.                     'class' => 'btn btn-info',
  25.                 ],
  26.                 'row_attr' => ['class' => 'ml-auto mr-auto w-100'],
  27.             ])
  28.         ;
  29.     }
  30.     public function configureOptions(OptionsResolver $resolver)
  31.     {
  32.         $resolver->setDefaults([
  33.             // Configure your form options here
  34.         ]);
  35.     }
  36. }