]>
Commit | Line | Data |
---|---|---|
7244d6cb NL |
1 | <?php |
2 | ||
3 | namespace Wallabag\CoreBundle\Form\Type; | |
4 | ||
5 | use Symfony\Component\Form\AbstractType; | |
619cc453 JB |
6 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; |
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 | |
619cc453 JB |
16 | ->add('label', TextType::class, array('required' => true)) |
17 | ->add('save', SubmitType::class) | |
7244d6cb NL |
18 | ; |
19 | } | |
20 | ||
21 | public function configureOptions(OptionsResolver $resolver) | |
22 | { | |
23 | $resolver->setDefaults(array( | |
24 | 'data_class' => 'Wallabag\CoreBundle\Entity\Tag', | |
25 | )); | |
26 | } | |
27 | ||
619cc453 | 28 | public function getBlockPrefix() |
7244d6cb NL |
29 | { |
30 | return 'tag'; | |
31 | } | |
32 | } |