diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2017-10-23 11:09:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 11:09:17 +0200 |
commit | 1953a872932a63792293b4aec087880265ba89f7 (patch) | |
tree | fd16599e737fcdaf193c933ef3ec4a4ee248b117 /src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php | |
parent | d83d25dadec2c38460a32d96f5d2903426fec9d3 (diff) | |
parent | 702f2d67d60ca963492b90dad74cb5f8dcc84e51 (diff) | |
download | wallabag-1953a872932a63792293b4aec087880265ba89f7.tar.gz wallabag-1953a872932a63792293b4aec087880265ba89f7.tar.zst wallabag-1953a872932a63792293b4aec087880265ba89f7.zip |
Merge pull request #3011 from wallabag/2.3
wallabag 2.3.0
Diffstat (limited to 'src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php')
-rw-r--r-- | src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php b/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php new file mode 100644 index 00000000..c73c3ded --- /dev/null +++ b/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php | |||
@@ -0,0 +1,35 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\AnnotationBundle\Form; | ||
4 | |||
5 | use Symfony\Component\Form\AbstractType; | ||
6 | use Symfony\Component\Form\Extension\Core\Type\CollectionType; | ||
7 | use Symfony\Component\Form\FormBuilderInterface; | ||
8 | use Symfony\Component\OptionsResolver\OptionsResolver; | ||
9 | use Wallabag\AnnotationBundle\Entity\Annotation; | ||
10 | |||
11 | class NewAnnotationType extends AbstractType | ||
12 | { | ||
13 | public function buildForm(FormBuilderInterface $builder, array $options) | ||
14 | { | ||
15 | $builder | ||
16 | ->add('text', null, [ | ||
17 | 'empty_data' => '', | ||
18 | ]) | ||
19 | ->add('quote', null, [ | ||
20 | 'empty_data' => null, | ||
21 | ]) | ||
22 | ->add('ranges', CollectionType::class, [ | ||
23 | 'entry_type' => RangeType::class, | ||
24 | 'allow_add' => true, | ||
25 | ]) | ||
26 | ; | ||
27 | } | ||
28 | |||
29 | public function configureOptions(OptionsResolver $resolver) | ||
30 | { | ||
31 | $resolver->setDefaults([ | ||
32 | 'data_class' => Annotation::class, | ||
33 | ]); | ||
34 | } | ||
35 | } | ||