<?php
namespace App\Form\Cart;
use App\Entity\Order\OrderLine;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\{NumberType, SubmitType};
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class AddToCartType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('quantity', NumberType::class, ['data'=>'1',
'attr' => ['class' => 'd-none hidden']
]);
$builder->add('add', SubmitType::class, [
'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" />',
'label_html' => true,
'attr' => [
'class' => 'd-flex text-transform-uppercase px-2'
]
]);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => OrderLine::class,
'label' => ' '
]);
}
}