wallabag/src/Form/Type/NewEntryType.php

36 lines
862 B
PHP
Raw Normal View History

2015-02-16 20:31:42 +00:00
<?php
2015-05-30 11:52:26 +00:00
2024-02-19 00:30:12 +00:00
namespace Wallabag\Form\Type;
2015-02-16 20:31:42 +00:00
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\UrlType;
2015-02-16 20:31:42 +00:00
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
2024-02-19 00:30:12 +00:00
use Wallabag\Entity\Entry;
2015-02-16 20:31:42 +00:00
class NewEntryType extends AbstractType
2015-02-16 20:31:42 +00:00
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('url', UrlType::class, [
'required' => true,
'label' => 'entry.new.form_new.url_label',
'default_protocol' => null,
])
2015-02-16 20:31:42 +00:00
;
}
public function configureOptions(OptionsResolver $resolver)
2015-02-16 20:31:42 +00:00
{
$resolver->setDefaults([
2022-09-01 18:54:56 +00:00
'data_class' => Entry::class,
]);
2015-02-16 20:31:42 +00:00
}
public function getBlockPrefix()
2015-02-16 20:31:42 +00:00
{
return 'entry';
}
}