]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/Form/Type/NewTagType.php
Merge pull request #1524 from wallabag/sf2.8
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Form / Type / NewTagType.php
CommitLineData
7244d6cb
NL
1<?php
2
3namespace Wallabag\CoreBundle\Form\Type;
4
5use Symfony\Component\Form\AbstractType;
619cc453
JB
6use Symfony\Component\Form\Extension\Core\Type\SubmitType;
7use Symfony\Component\Form\Extension\Core\Type\TextType;
7244d6cb
NL
8use Symfony\Component\Form\FormBuilderInterface;
9use Symfony\Component\OptionsResolver\OptionsResolver;
10
11class 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}