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;
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',
+ ])
;
}
public function configureOptions(OptionsResolver $resolver)
{
- $resolver->setDefaults(array(
+ $resolver->setDefaults([
'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
- ));
+ ]);
}
- public function getName()
+ public function getBlockPrefix()
{
return 'entry';
}