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;
|
2015-12-22 09:16:34 +00:00
|
|
|
use Symfony\Component\Form\Extension\Core\Type\UrlType;
|
2015-02-16 20:31:42 +00:00
|
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
2015-06-02 14:58:19 +00:00
|
|
|
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
|
|
|
|
2015-06-02 16:54:34 +00:00
|
|
|
class NewEntryType extends AbstractType
|
2015-02-16 20:31:42 +00:00
|
|
|
{
|
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
|
|
|
{
|
|
|
|
$builder
|
2016-04-12 09:36:01 +00:00
|
|
|
->add('url', UrlType::class, [
|
2016-03-09 07:59:08 +00:00
|
|
|
'required' => true,
|
|
|
|
'label' => 'entry.new.form_new.url_label',
|
2019-02-08 14:03:52 +00:00
|
|
|
'default_protocol' => null,
|
2016-04-12 09:36:01 +00:00
|
|
|
])
|
2015-02-16 20:31:42 +00:00
|
|
|
;
|
|
|
|
}
|
|
|
|
|
2015-06-02 14:58:19 +00:00
|
|
|
public function configureOptions(OptionsResolver $resolver)
|
2015-02-16 20:31:42 +00:00
|
|
|
{
|
2016-04-12 09:36:01 +00:00
|
|
|
$resolver->setDefaults([
|
2022-09-01 18:54:56 +00:00
|
|
|
'data_class' => Entry::class,
|
2016-04-12 09:36:01 +00:00
|
|
|
]);
|
2015-02-16 20:31:42 +00:00
|
|
|
}
|
|
|
|
|
2015-12-22 09:16:34 +00:00
|
|
|
public function getBlockPrefix()
|
2015-02-16 20:31:42 +00:00
|
|
|
{
|
|
|
|
return 'entry';
|
|
|
|
}
|
|
|
|
}
|