Password example

public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if ($this->config->get('accountPasswordCheck')) {
            $builder->add('currentPassword', PasswordType::class[
                'mapped' => false,
                'constraints' => [new CurrentPassword()],
            ]);
        }

        $builder->add('password', PasswordType::class[
            'constraints' => [new Password()],
        ]);

        $builder->add('passwordConfirmation', PasswordType::class[
            'mapped' => false,
        ]);

        $builder->add('attribute', AttributeFormType::class[
            'data_class' => CustomerAttribute::class,
        ]);

        $builder->add('additional', null, [
            

            $event->setData($data);
        });

        $builder->add('email', EmailType::class[
            'constraints' => [
                new FormEmail(['shop' => $this->context->getShopContext()->getShop()]),
            ],
        ]);

        $builder->add('password', PasswordType::class[
            'constraints' => [new Password()],
        ]);

        if ($this->config->get('doublepasswordvalidation')) {
            $builder->add('passwordConfirmation', PasswordType::class[
                'mapped' => false,
            ]);
        }

        if ($this->config->get('doubleemailvalidation')) {
            $builder->add('emailConfirmation', EmailType::class[
                'mapped' => false,
            ]);

        $resolver->setDefaults([
            'data_class' => Customer::class,
            'allow_extra_fields' => true,
        ]);
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('password', PasswordType::class[
                'constraints' => [new Password()],
            ])
            ->add('passwordConfirmation', PasswordType::class[
                'mapped' => false,
            ]);
    }

    /** * @return string */
    public function getBlockPrefix()
    {
        
Home | Imprint | This part of the site doesn't use cookies.