|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace AppBundle\Form; |
|
4
|
|
|
|
|
5
|
|
|
use Symfony\Component\Form\AbstractType; |
|
6
|
|
|
use Symfony\Component\Form\Extension\Core\Type\EmailType; |
|
7
|
|
|
use Symfony\Component\Form\Extension\Core\Type\PasswordType; |
|
8
|
|
|
use Symfony\Component\Form\Extension\Core\Type\RepeatedType; |
|
9
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType; |
|
10
|
|
|
use Symfony\Component\Form\FormBuilderInterface; |
|
11
|
|
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
|
12
|
|
|
|
|
13
|
|
|
class UpdateUserSocialNetType extends AbstractType |
|
14
|
|
|
{ |
|
15
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options) |
|
16
|
|
|
{ |
|
17
|
|
|
$builder |
|
18
|
|
|
->add('email', EmailType::class, [ |
|
19
|
|
|
'disabled' => true, |
|
20
|
|
|
'attr' => [ |
|
21
|
|
|
'class' => 'form-control', |
|
22
|
|
|
'placeholder' => 'enter email' |
|
23
|
|
|
] |
|
24
|
|
|
]) |
|
25
|
|
|
->add('firstName', TextType::class, [ |
|
26
|
|
|
'attr' => [ |
|
27
|
|
|
'class' => 'form-control', |
|
28
|
|
|
'placeholder' => 'enter first name' |
|
29
|
|
|
] |
|
30
|
|
|
]) |
|
31
|
|
|
->add('lastName', TextType::class, [ |
|
32
|
|
|
'attr' => [ |
|
33
|
|
|
'class' => 'form-control', |
|
34
|
|
|
'placeholder' => 'enter last name' |
|
35
|
|
|
] |
|
36
|
|
|
]) |
|
37
|
|
|
->add('plain_password', RepeatedType::class, [ |
|
38
|
|
|
'type' => PasswordType::class, |
|
39
|
|
|
'required' => false, |
|
40
|
|
|
'invalid_message' => 'The password fields must match.', |
|
41
|
|
|
'options' => [ |
|
42
|
|
|
'attr' => [ |
|
43
|
|
|
'class' => 'form-control', |
|
44
|
|
|
] |
|
45
|
|
|
], |
|
46
|
|
|
'first_options' => ['label' => 'Password'], |
|
47
|
|
|
'second_options' => ['label' => 'Repeat Password'], |
|
48
|
|
|
] |
|
49
|
|
|
); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
public function configureOptions(OptionsResolver $resolver) |
|
53
|
|
|
{ |
|
54
|
|
|
$resolver->setDefaults(array( |
|
55
|
|
|
'data_class' => 'AppBundle\Entity\User' |
|
56
|
|
|
)); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
public function getBlockPrefix() |
|
60
|
|
|
{ |
|
61
|
|
|
return 'app_bundle_user_type'; |
|
62
|
|
|
} |
|
63
|
|
|
} |
|
64
|
|
|
|