]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/Form/Type/NewTagType.php
Added new tag form in mobile view for Material theme
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Form / Type / NewTagType.php
1 <?php
2
3 namespace Wallabag\CoreBundle\Form\Type;
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 NewTagType extends AbstractType
12 {
13 public function buildForm(FormBuilderInterface $builder, array $options)
14 {
15 $builder
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 ])
25 ;
26 }
27
28 public function configureOptions(OptionsResolver $resolver)
29 {
30 $resolver->setDefaults([
31 'data_class' => 'Wallabag\CoreBundle\Entity\Tag',
32 ]);
33 }
34
35 public function getBlockPrefix()
36 {
37 return 'tag';
38 }
39 }