CurrentPassword example

new FormEmail(['shop' => $this->context->getShopContext()->getShop()]),
            ],
        ]);

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

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

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

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

    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,
        ]);

        
Home | Imprint | This part of the site doesn't use cookies.