]>
Commit | Line | Data |
---|---|---|
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 | } |