diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Form')
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/EditEntryType.php | 36 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/NewEntryType.php (renamed from src/Wallabag/CoreBundle/Form/Type/EntryType.php) | 2 |
2 files changed, 37 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php new file mode 100644 index 00000000..0fa4b71f --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php | |||
@@ -0,0 +1,36 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Form\Type; | ||
4 | |||
5 | use Symfony\Component\Form\AbstractType; | ||
6 | use Symfony\Component\Form\FormBuilderInterface; | ||
7 | use Symfony\Component\OptionsResolver\OptionsResolver; | ||
8 | |||
9 | class EditEntryType extends AbstractType | ||
10 | { | ||
11 | public function buildForm(FormBuilderInterface $builder, array $options) | ||
12 | { | ||
13 | $builder | ||
14 | ->add('title', 'text', array('required' => true)) | ||
15 | ->add('is_public', 'checkbox', array('required' => false)) | ||
16 | // @todo: add autocomplete | ||
17 | // ->add('tags', 'entity', array( | ||
18 | // 'class' => 'Wallabag\CoreBundle\Entity\Tag', | ||
19 | // 'choice_translation_domain' => true, | ||
20 | // )) | ||
21 | ->add('save', 'submit') | ||
22 | ; | ||
23 | } | ||
24 | |||
25 | public function configureOptions(OptionsResolver $resolver) | ||
26 | { | ||
27 | $resolver->setDefaults(array( | ||
28 | 'data_class' => 'Wallabag\CoreBundle\Entity\Entry', | ||
29 | )); | ||
30 | } | ||
31 | |||
32 | public function getName() | ||
33 | { | ||
34 | return 'entry'; | ||
35 | } | ||
36 | } | ||
diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryType.php b/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php index 0532bf10..a2d203ea 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EntryType.php +++ b/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php | |||
@@ -6,7 +6,7 @@ use Symfony\Component\Form\AbstractType; | |||
6 | use Symfony\Component\Form\FormBuilderInterface; | 6 | use Symfony\Component\Form\FormBuilderInterface; |
7 | use Symfony\Component\OptionsResolver\OptionsResolverInterface; | 7 | use Symfony\Component\OptionsResolver\OptionsResolverInterface; |
8 | 8 | ||
9 | class EntryType extends AbstractType | 9 | class NewEntryType extends AbstractType |
10 | { | 10 | { |
11 | public function buildForm(FormBuilderInterface $builder, array $options) | 11 | public function buildForm(FormBuilderInterface $builder, array $options) |
12 | { | 12 | { |