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/NewGroupType.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/NewGroupType.php')
-rw-r--r-- | src/Wallabag/GroupBundle/Form/NewGroupType.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/Wallabag/GroupBundle/Form/NewGroupType.php b/src/Wallabag/GroupBundle/Form/NewGroupType.php new file mode 100644 index 00000000..29b20fe0 --- /dev/null +++ b/src/Wallabag/GroupBundle/Form/NewGroupType.php | |||
@@ -0,0 +1,37 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\GroupBundle\Form; | ||
4 | |||
5 | use Symfony\Component\Form\AbstractType; | ||
6 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; | ||
7 | use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
8 | use Symfony\Component\Form\FormBuilderInterface; | ||
9 | use Symfony\Component\OptionsResolver\OptionsResolver; | ||
10 | |||
11 | class NewGroupType extends AbstractType | ||
12 | { | ||
13 | public function buildForm(FormBuilderInterface $builder, array $options) | ||
14 | { | ||
15 | $builder | ||
16 | ->add('name', TextType::class, [ | ||
17 | 'required' => true, | ||
18 | 'label' => 'group.form.name_label', | ||
19 | ]) | ||
20 | ->add('save', SubmitType::class, [ | ||
21 | 'label' => 'group.form.save', | ||
22 | ]) | ||
23 | ; | ||
24 | } | ||
25 | |||
26 | public function configureOptions(OptionsResolver $resolver) | ||
27 | { | ||
28 | $resolver->setDefaults([ | ||
29 | 'data_class' => 'Wallabag\GroupBundle\Entity\Group', | ||
30 | ]); | ||
31 | } | ||
32 | |||
33 | public function getBlockPrefix() | ||
34 | { | ||
35 | return 'new_group'; | ||
36 | } | ||
37 | } | ||