diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-11-03 12:11:48 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2017-06-23 09:22:54 +0200 |
commit | 36f30fa31e0d2373f5c39851ea9138493fbde341 (patch) | |
tree | f6bba0092e72e21a3f10579250f9b2ec1e41ed70 /src/Wallabag/GroupBundle/Form/GroupType.php | |
parent | e7d2d1bd8ff956c324641070801e1460c06ffaa1 (diff) | |
download | wallabag-36f30fa31e0d2373f5c39851ea9138493fbde341.tar.gz wallabag-36f30fa31e0d2373f5c39851ea9138493fbde341.tar.zst wallabag-36f30fa31e0d2373f5c39851ea9138493fbde341.zip |
Added groups management
Diffstat (limited to 'src/Wallabag/GroupBundle/Form/GroupType.php')
-rw-r--r-- | src/Wallabag/GroupBundle/Form/GroupType.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/Wallabag/GroupBundle/Form/GroupType.php b/src/Wallabag/GroupBundle/Form/GroupType.php new file mode 100644 index 00000000..c2ad764b --- /dev/null +++ b/src/Wallabag/GroupBundle/Form/GroupType.php | |||
@@ -0,0 +1,39 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\GroupBundle\Form; | ||
4 | |||
5 | use Symfony\Component\Form\AbstractType; | ||
6 | use Symfony\Component\Form\FormBuilderInterface; | ||
7 | use Symfony\Component\OptionsResolver\OptionsResolver; | ||
8 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; | ||
9 | use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
10 | |||
11 | class GroupType extends AbstractType | ||
12 | { | ||
13 | /** | ||
14 | * @param FormBuilderInterface $builder | ||
15 | * @param array $options | ||
16 | */ | ||
17 | public function buildForm(FormBuilderInterface $builder, array $options) | ||
18 | { | ||
19 | $builder | ||
20 | ->add('name', TextType::class, [ | ||
21 | 'required' => false, | ||
22 | 'label' => 'group.form.name_label', | ||
23 | ]) | ||
24 | ->add('save', SubmitType::class, [ | ||
25 | 'label' => 'group.form.save', | ||
26 | ]) | ||
27 | ; | ||
28 | } | ||
29 | |||
30 | /** | ||
31 | * @param OptionsResolver $resolver | ||
32 | */ | ||
33 | public function configureOptions(OptionsResolver $resolver) | ||
34 | { | ||
35 | $resolver->setDefaults(array( | ||
36 | 'data_class' => 'Wallabag\GroupBundle\Entity\Group', | ||
37 | )); | ||
38 | } | ||
39 | } | ||