FormEmail example

array_walk_recursive($datafunction D&$item$key) use ($whitelist) {
                if (\in_array($key$whitelist, true)) {
                    return $item;
                }
                $item = strip_tags($item);
            });
            $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,
            ]);
        }

    public function getBlockPrefix()
    {
        return 'email';
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('email', EmailType::class[
            'constraints' => [
                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()],
            ]);
Home | Imprint | This part of the site doesn't use cookies.