]>
Commit | Line | Data |
---|---|---|
7244d6cb NL |
1 | <?php |
2 | ||
3 | namespace Wallabag\CoreBundle\Form\Type; | |
4 | ||
5 | use Symfony\Component\Form\AbstractType; | |
df30af69 | 6 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; |
619cc453 | 7 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
7244d6cb NL |
8 | use Symfony\Component\Form\FormBuilderInterface; |
9 | use Symfony\Component\OptionsResolver\OptionsResolver; | |
10 | ||
11 | class NewTagType extends AbstractType | |
12 | { | |
13 | public function buildForm(FormBuilderInterface $builder, array $options) | |
14 | { | |
15 | $builder | |
df30af69 NL |
16 | ->add('label', TextType::class, [ |
17 | 'required' => true, | |
18 | 'attr' => [ | |
19 | 'placeholder' => 'tag.new.placeholder', | |
20 | ], | |
21 | ]) | |
22 | ->add('add', SubmitType::class, [ | |
23 | 'label' => 'tag.new.add', | |
24 | ]) | |
7244d6cb NL |
25 | ; |
26 | } | |
27 | ||
28 | public function configureOptions(OptionsResolver $resolver) | |
29 | { | |
4094ea47 | 30 | $resolver->setDefaults([ |
7244d6cb | 31 | 'data_class' => 'Wallabag\CoreBundle\Entity\Tag', |
4094ea47 | 32 | ]); |
7244d6cb NL |
33 | } |
34 | ||
619cc453 | 35 | public function getBlockPrefix() |
7244d6cb NL |
36 | { |
37 | return 'tag'; | |
38 | } | |
39 | } |