mirror of
https://github.com/wallabag/wallabag.git
synced 2024-09-27 05:50:02 +00:00
36 lines
994 B
PHP
36 lines
994 B
PHP
<?php
|
|
|
|
namespace Wallabag\CoreBundle\Form\Type;
|
|
|
|
use Symfony\Component\Form\AbstractType;
|
|
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
use Wallabag\CoreBundle\Entity\Annotation;
|
|
|
|
class NewAnnotationType extends AbstractType
|
|
{
|
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
|
{
|
|
$builder
|
|
->add('text', null, [
|
|
'empty_data' => '',
|
|
])
|
|
->add('quote', null, [
|
|
'empty_data' => '',
|
|
'trim' => false,
|
|
])
|
|
->add('ranges', CollectionType::class, [
|
|
'entry_type' => RangeType::class,
|
|
'allow_add' => true,
|
|
])
|
|
;
|
|
}
|
|
|
|
public function configureOptions(OptionsResolver $resolver)
|
|
{
|
|
$resolver->setDefaults([
|
|
'data_class' => Annotation::class,
|
|
]);
|
|
}
|
|
}
|