diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2017-10-23 11:09:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 11:09:17 +0200 |
commit | 1953a872932a63792293b4aec087880265ba89f7 (patch) | |
tree | fd16599e737fcdaf193c933ef3ec4a4ee248b117 /src/Wallabag/CoreBundle/Form/Type/SiteCredentialType.php | |
parent | d83d25dadec2c38460a32d96f5d2903426fec9d3 (diff) | |
parent | 702f2d67d60ca963492b90dad74cb5f8dcc84e51 (diff) | |
download | wallabag-1953a872932a63792293b4aec087880265ba89f7.tar.gz wallabag-1953a872932a63792293b4aec087880265ba89f7.tar.zst wallabag-1953a872932a63792293b4aec087880265ba89f7.zip |
Merge pull request #3011 from wallabag/2.3
wallabag 2.3.0
Diffstat (limited to 'src/Wallabag/CoreBundle/Form/Type/SiteCredentialType.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/SiteCredentialType.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/SiteCredentialType.php b/src/Wallabag/CoreBundle/Form/Type/SiteCredentialType.php new file mode 100644 index 00000000..fd409ad2 --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/SiteCredentialType.php | |||
@@ -0,0 +1,44 @@ | |||
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', | ||
22 | 'data' => '', | ||
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 | } | ||