]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - 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
index c7568de772ffe4c75d86cc8b9ea4e9af8d8f44d5..e830ade480d7dde9a4bb4b819cb093b563b1e141 100644 (file)
@@ -3,6 +3,7 @@
 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;
@@ -12,15 +13,23 @@ class NewTagType extends AbstractType
     public function buildForm(FormBuilderInterface $builder, array $options)
     {
         $builder
-            ->add('label', TextType::class, array('required' => true))
+            ->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 getBlockPrefix()