]>
Commit | Line | Data |
---|---|---|
f92fcb53 JB |
1 | <?php |
2 | ||
3 | namespace Wallabag\CoreBundle\Form\Type; | |
4 | ||
5 | use Symfony\Component\Form\AbstractType; | |
6 | use Symfony\Component\Form\Extension\Core\Type\PasswordType; | |
7 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; | |
8 | use Symfony\Component\Form\Extension\Core\Type\TextType; | |
9 | use Symfony\Component\Form\FormBuilderInterface; | |
10 | use Symfony\Component\OptionsResolver\OptionsResolver; | |
11 | ||
12 | class SiteCredentialType extends AbstractType | |
13 | { | |
14 | public function buildForm(FormBuilderInterface $builder, array $options) | |
15 | { | |
16 | $builder | |
17 | ->add('host', TextType::class, [ | |
18 | 'label' => 'site_credential.form.host_label', | |
19 | ]) | |
20 | ->add('username', TextType::class, [ | |
21 | 'label' => 'site_credential.form.username_label', | |
bead8b42 | 22 | 'data' => '', |
f92fcb53 JB |
23 | ]) |
24 | ->add('password', PasswordType::class, [ | |
25 | 'label' => 'site_credential.form.password_label', | |
26 | ]) | |
27 | ->add('save', SubmitType::class, [ | |
28 | 'label' => 'config.form.save', | |
29 | ]) | |
30 | ; | |
31 | } | |
32 | ||
33 | public function configureOptions(OptionsResolver $resolver) | |
34 | { | |
35 | $resolver->setDefaults([ | |
36 | 'data_class' => 'Wallabag\CoreBundle\Entity\SiteCredential', | |
37 | ]); | |
38 | } | |
39 | ||
40 | public function getBlockPrefix() | |
41 | { | |
42 | return 'site_credential'; | |
43 | } | |
44 | } |