src/Flexy/FrontBundle/Themes/IlaveU/Form/RegistrationCustomerFormType.php line 20
<?php
namespace App\Flexy\FrontBundle\Themes\IlaveU\Form;
use App\Entity\User;
use App\Flexy\ShopBundle\Entity\Customer\Customer;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\IsTrue;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Validator\Constraints\Email;
class RegistrationCustomerFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
//->add('description')
->add('customerGroup',null,[
"required"=>true,
"label"=>"Vous etes un client ",
'expanded' => true,
'multiple' => false,
"row_attr"=>["class"=>"col-md-12"]
])
->add('email',EmailType::class,
[
"required"=> true,
'constraints' => [new Email()]
])
->add('user', UserPasswordFormType::class, [
])
//->add('createdAt')
->add('firstName')
->add('lastName')
->add('address',null,["required"=> true])
->add('phone')
->add('companyName')
->add('dateOfBirth',DateType::class, ['required'=>false,
'widget' => 'single_text'])
->add('gender', ChoiceType::class, [
'choices' => [
'Male'=> 'male',
'Female'=> 'female',
],])
->add('addressIndication')
//->add('country')
->add('postCode')
//->add('customerGroup')
->add("canReceiveMails")
->add("canReceiveSms")
->add('agreeTerms', CheckboxType::class, [
"label"=>'Accepter les conditions génerales',
'mapped' => false,
'constraints' => [
new IsTrue([
'message' => 'You should agree to our terms.',
]),
],
])
->add('sponsorshipCode',null,["label"=>"Code Parrainage"])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Customer::class,
]);
}
}