3 namespace Wallabag\UserBundle\Form
;
5 use Symfony\Component\Form\AbstractType
;
6 use Symfony\Component\Form\Extension\Core\Type\CheckboxType
;
7 use Symfony\Component\Form\Extension\Core\Type\EmailType
;
8 use Symfony\Component\Form\Extension\Core\Type\SubmitType
;
9 use Symfony\Component\Form\Extension\Core\Type\TextType
;
10 use Symfony\Component\Form\FormBuilderInterface
;
11 use Symfony\Component\OptionsResolver\OptionsResolver
;
13 class UserType
extends AbstractType
16 * @param FormBuilderInterface $builder
17 * @param array $options
19 public function buildForm(FormBuilderInterface
$builder, array $options)
22 ->add('name', TextType
::class, [
24 'label' => 'user.form.name_label',
26 ->add('username', TextType
::class, [
28 'label' => 'user.form.username_label',
30 ->add('email', EmailType
::class, [
32 'label' => 'user.form.email_label',
34 ->add('enabled', CheckboxType
::class, [
36 'label' => 'user.form.enabled_label',
38 ->add('emailTwoFactor', CheckboxType
::class, [
40 'label' => 'user.form.twofactor_email_label',
42 ->add('googleTwoFactor', CheckboxType
::class, [
44 'label' => 'user.form.twofactor_google_label',
47 ->add('save', SubmitType
::class, [
48 'label' => 'user.form.save',
54 * @param OptionsResolver $resolver
56 public function configureOptions(OptionsResolver
$resolver)
58 $resolver->setDefaults([
59 'data_class' => 'Wallabag\UserBundle\Entity\User',