|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace AppBundle\Form; |
|
4
|
|
|
|
|
5
|
|
|
use AppBundle\Entity\User; |
|
6
|
|
|
use Symfony\Component\Form\AbstractType; |
|
7
|
|
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; |
|
8
|
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
|
9
|
|
|
use Symfony\Component\Form\Extension\Core\Type\EmailType; |
|
10
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType; |
|
11
|
|
|
use Symfony\Component\Form\FormBuilderInterface; |
|
12
|
|
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
|
13
|
|
|
|
|
14
|
|
|
class UpdateUserType extends AbstractType |
|
15
|
|
|
{ |
|
16
|
1 |
|
public function buildForm(FormBuilderInterface $builder, array $options) |
|
17
|
|
|
{ |
|
18
|
|
|
$builder |
|
19
|
1 |
|
->add('email', EmailType::class, [ |
|
20
|
1 |
|
'disabled' => true, |
|
21
|
|
|
'attr' => [ |
|
22
|
1 |
|
'class' => 'form-control', |
|
23
|
|
|
'placeholder' => 'enter first name' |
|
24
|
1 |
|
] |
|
25
|
1 |
|
]) |
|
26
|
1 |
|
->add('firstName', TextType::class, [ |
|
27
|
|
|
'attr' => [ |
|
28
|
1 |
|
'class' => 'form-control', |
|
29
|
|
|
'placeholder' => 'enter first name' |
|
30
|
1 |
|
] |
|
31
|
1 |
|
]) |
|
32
|
1 |
|
->add('lastName', TextType::class, [ |
|
33
|
|
|
'attr' => [ |
|
34
|
1 |
|
'class' => 'form-control', |
|
35
|
|
|
'placeholder' => 'enter last name' |
|
36
|
1 |
|
] |
|
37
|
1 |
|
]) |
|
38
|
1 |
|
->add('is_locked', CheckboxType::class, [ |
|
39
|
1 |
|
'label' => 'Locked', |
|
40
|
|
|
'required' => false |
|
41
|
1 |
|
]); |
|
42
|
1 |
|
} |
|
43
|
|
|
|
|
44
|
1 |
|
public function configureOptions(OptionsResolver $resolver) |
|
45
|
|
|
{ |
|
46
|
1 |
|
$resolver->setDefaults([ |
|
47
|
|
|
'data_class' => 'AppBundle\Entity\User' |
|
48
|
1 |
|
]); |
|
49
|
1 |
|
} |
|
50
|
|
|
|
|
51
|
|
|
} |