]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Form/Type/NewTagType.php
Merge pull request #2878 from matteocoder/wallabag-docs-ita
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Form / Type / NewTagType.php
index 8e4ab649b050646e7ded31037035f3e4a223b7f9..e830ade480d7dde9a4bb4b819cb093b563b1e141 100644 (file)
@@ -3,6 +3,8 @@
 namespace Wallabag\CoreBundle\Form\Type;
 
 use Symfony\Component\Form\AbstractType;
+use Symfony\Component\Form\Extension\Core\Type\SubmitType;
+use Symfony\Component\Form\Extension\Core\Type\TextType;
 use Symfony\Component\Form\FormBuilderInterface;
 use Symfony\Component\OptionsResolver\OptionsResolver;
 
@@ -11,19 +13,26 @@ class NewTagType extends AbstractType
     public function buildForm(FormBuilderInterface $builder, array $options)
     {
         $builder
-            ->add('label', 'text', array('required' => true))
-            ->add('save', 'submit')
+            ->add('label', TextType::class, [
+                'required' => true,
+                'attr' => [
+                    'placeholder' => 'tag.new.placeholder',
+                ],
+            ])
+            ->add('add', SubmitType::class, [
+                'label' => 'tag.new.add',
+            ])
         ;
     }
 
     public function configureOptions(OptionsResolver $resolver)
     {
-        $resolver->setDefaults(array(
+        $resolver->setDefaults([
             'data_class' => 'Wallabag\CoreBundle\Entity\Tag',
-        ));
+        ]);
     }
 
-    public function getName()
+    public function getBlockPrefix()
     {
         return 'tag';
     }