Your IP : 216.73.217.79


Current Path : /var/www/v3.cesa.co.za/src/UserBundle/Form/Type/
Upload File :
Current File : /var/www/v3.cesa.co.za/src/UserBundle/Form/Type/UserForgotPwType.php

<?php

namespace App\UserBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\Email;
use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaV3Type;

class UserForgotPwType extends AbstractType {

    private $serviceContainer = null;
    private $myDetails = false;

    public function __construct(ContainerInterface $serviceContainer, $myDetails = false) {
        $this->serviceContainer = $serviceContainer;
        $this->myDetails = $myDetails;
    }

    public function getServiceContainer() {
        return $this->serviceContainer;
    }

    public function buildForm(FormBuilderInterface $builder, array $options) {

        $builder->add(
                        'e_mail_address_string', EmailType::class, array(
                    'constraints' => array(
                        new Length(array('min' => 0, 'max' => 255)),
                        new Email(),
                    ),
                    'label' => 'E-Mail: *',
                    'attr' => array('placeholder' => 'E-Mail', 'class' => 'form-control'),
                    'required' => true,
                        )
                )
                ->add(
                        'recaptcha', EWZRecaptchaV3Type::class, array(
                    'mapped' => false,
                    'attr' => array(
                        'options' => array(
                            'theme' => 'light',
                            'type' => 'image',
                            'size' => 'normal',
                            'defer' => true,
                            'async' => true,
                        )
                    ),
                    'label' => ' ',
                        )
                )
        ;

//        $systemSettingManager = $this->serviceContainer->get('system_setting.manager');
//        if ($systemSettingManager->getSetting('go_digital') > 0) {
//            $builder->remove('captcha')
//                    ->add(
//                            'captcha', EWZRecaptchaV3Type::class, array(
//                        'mapped' => false,
//                            )
//                    )
//            ;
//        }
    }

    public function getParent() {
        return \Symfony\Component\Form\Extension\Core\Type\FormType::class;
    }

    public function getName() {
        return 'user_forgot_pw';
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver) {

    }
}