src/Form/Cart/AddToCartType.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Form\Cart;
  3. use App\Entity\Order\OrderLine;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\Extension\Core\Type\{NumberTypeSubmitType};
  6. use Symfony\Component\Form\FormBuilderInterface;
  7. use Symfony\Component\OptionsResolver\OptionsResolver;
  8. class AddToCartType extends AbstractType
  9. {
  10.     public function buildForm(FormBuilderInterface $builder, array $options)
  11.     {
  12.         $builder->add('quantity'NumberType::class, ['data'=>'1'
  13.             'attr' => ['class' => 'd-none hidden']
  14.         ]);
  15.         $builder->add('add'SubmitType::class, [
  16.             'label' => '<span class="w-100 my-auto fs-12">Ajouter à mon offre</span> <img height="20px" class="add-to-cart-icon my-auto" src="/images/logo/paner.png" />',
  17.             'label_html' => true,
  18.             'attr' => [
  19.                 'class' => 'd-flex text-transform-uppercase px-2'
  20.             ]
  21.         ]);
  22.     }
  23.     public function configureOptions(OptionsResolver $resolver)
  24.     {
  25.         $resolver->setDefaults([
  26.             'data_class' => OrderLine::class,
  27.             'label' => ' '
  28.         ]);
  29.     }
  30. }