Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
reminec
Limaju Server Symfony
Commits
c2186b2c
Commit
c2186b2c
authored
Oct 03, 2020
by
reminec
Browse files
No more use of form register
parent
7a175310
Pipeline
#343042
failed with stage
in 5 minutes and 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/Form/RegistrationType.php
deleted
100644 → 0
View file @
7a175310
<?php
declare
(
strict_types
=
1
);
namespace
App\Form
;
use
Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity
;
use
Symfony\Component\Form\AbstractType
;
use
Symfony\Component\Form\Extension\Core\Type\EmailType
;
use
Symfony\Component\Form\Extension\Core\Type\PasswordType
;
use
Symfony\Component\Form\FormBuilderInterface
;
use
Symfony\Component\Validator\Constraints\Email
;
use
Symfony\Component\Validator\Constraints\Length
;
use
Symfony\Component\Validator\Constraints\NotBlank
;
/**
* IMPORTANT NOTE
* HashedPasswordType expects password to ba an associative array like so: ['plain'=>'$3çREt!'}
*
* Class RegistrationType
* @package App\Form
*/
final
class
RegistrationType
extends
AbstractType
{
public
function
buildForm
(
FormBuilderInterface
$builder
,
array
$options
):
void
{
$builder
->
add
(
'email'
,
EmailType
::
class
,
[
'constraints'
=>
[
new
NotBlank
(),
new
Email
(),
new
UniqueEntity
([
'fields'
=>
'email'
]),
],
]);
$builder
->
add
(
'password'
,
HashedPasswordType
::
class
,
[
'password_options'
=>
[
'constraints'
=>
[
new
NotBlank
(),
new
Length
([
'max'
=>
1024
]),
],
],
]);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment