src/Eccube/Form/Type/Front/ForgotType.php line 26

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Eccube\Form\Type\Front;
  13. use Eccube\Common\EccubeConfig;
  14. use Eccube\Form\Validator\Email;
  15. use Symfony\Component\Form\AbstractType;
  16. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  17. use Symfony\Component\Form\FormBuilderInterface;
  18. use Symfony\Component\Validator\Constraints as Assert;
  19. /**
  20.  * Class ForgotType
  21.  */
  22. class ForgotType extends AbstractType
  23. {
  24.     /**
  25.      * @var EccubeConfig
  26.      */
  27.     protected $eccubeConfig;
  28.     /**
  29.      * ForgotType constructor.
  30.      *
  31.      * @param EccubeConfig $eccubeConfig
  32.      */
  33.     public function __construct(EccubeConfig $eccubeConfig)
  34.     {
  35.         $this->eccubeConfig $eccubeConfig;
  36.     }
  37.     /**
  38.      * {@inheritdoc}
  39.      */
  40.     public function buildForm(FormBuilderInterface $builder, array $options)
  41.     {
  42.         $builder->add('login_email'EmailType::class, [
  43.             'attr' => [
  44.                 'maxlength' => $this->eccubeConfig['eccube_stext_len'],
  45.             ],
  46.             'constraints' => [
  47.                 new Assert\NotBlank(),
  48.                 new Email(nullnull$this->eccubeConfig['eccube_rfc_email_check'] ? 'strict' null),
  49.             ],
  50.         ]);
  51.     }
  52.     /**
  53.      * {@inheritdoc}
  54.      */
  55.     public function getBlockPrefix()
  56.     {
  57.         return 'forgot';
  58.     }
  59. }