aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStéphane HULARD <s.hulard@chstudio.fr>2018-01-23 19:09:03 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2018-09-25 10:18:08 +0200
commita664a1d876174e9d61d8324039ee86d2b6bf164d (patch)
treea59d184e62083974b85591de8a906b85beddc83e /src
parent2b6380f5acaecaa7aa04c12d7bf4fd7c84b60b08 (diff)
downloadwallabag-a664a1d876174e9d61d8324039ee86d2b6bf164d.tar.gz
wallabag-a664a1d876174e9d61d8324039ee86d2b6bf164d.tar.zst
wallabag-a664a1d876174e9d61d8324039ee86d2b6bf164d.zip
Rename Tag : Add a new FormType
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/RenameTagType.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/RenameTagType.php b/src/Wallabag/CoreBundle/Form/Type/RenameTagType.php
new file mode 100644
index 00000000..e6270048
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Form/Type/RenameTagType.php
@@ -0,0 +1,35 @@
1<?php
2
3namespace Wallabag\CoreBundle\Form\Type;
4
5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\TextType;
7use Symfony\Component\Form\FormBuilderInterface;
8use Symfony\Component\OptionsResolver\OptionsResolver;
9
10class RenameTagType extends AbstractType
11{
12 public function buildForm(FormBuilderInterface $builder, array $options)
13 {
14 $builder
15 ->add('label', TextType::class, [
16 'required' => true,
17 'attr' => [
18 'placeholder' => 'tag.rename.placeholder',
19 ],
20 ])
21 ;
22 }
23
24 public function configureOptions(OptionsResolver $resolver)
25 {
26 $resolver->setDefaults([
27 'data_class' => 'Wallabag\CoreBundle\Entity\Tag',
28 ]);
29 }
30
31 public function getBlockPrefix()
32 {
33 return 'tag';
34 }
35}