]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Form/Type/NewEntryType.php
Merge pull request #3984 from wallabag/2.4
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Form / Type / NewEntryType.php
index cb96d11a2aa79194eeb11afa79c17c109d3b04b5..7af1e5895f4492a229e3e7ffbcd491a94c498d0e 100644 (file)
@@ -3,6 +3,7 @@
 namespace Wallabag\CoreBundle\Form\Type;
 
 use Symfony\Component\Form\AbstractType;
+use Symfony\Component\Form\Extension\Core\Type\UrlType;
 use Symfony\Component\Form\FormBuilderInterface;
 use Symfony\Component\OptionsResolver\OptionsResolver;
 
@@ -11,19 +12,22 @@ class NewEntryType extends AbstractType
     public function buildForm(FormBuilderInterface $builder, array $options)
     {
         $builder
-            ->add('url', 'url', array('required' => true))
-            ->add('save', 'submit')
+            ->add('url', UrlType::class, [
+                'required' => true,
+                'label' => 'entry.new.form_new.url_label',
+                'default_protocol' => null,
+            ])
         ;
     }
 
     public function configureOptions(OptionsResolver $resolver)
     {
-        $resolver->setDefaults(array(
+        $resolver->setDefaults([
             'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
-        ));
+        ]);
     }
 
-    public function getName()
+    public function getBlockPrefix()
     {
         return 'entry';
     }