X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FForm%2FType%2FNewEntryType.php;h=7af1e5895f4492a229e3e7ffbcd491a94c498d0e;hb=9f0957b831622ee577fa7d8f92ec0df6f3a8e274;hp=cb96d11a2aa79194eeb11afa79c17c109d3b04b5;hpb=ac9d58211e1c6676485ef15d023215e5a465f3a8;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php b/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php index cb96d11a..7af1e589 100644 --- a/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php +++ b/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php @@ -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'; }