]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | ||
3 | namespace Wallabag\CoreBundle\Form\Type; | |
4 | ||
5 | use Symfony\Component\Form\AbstractType; | |
6 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; | |
7 | use Symfony\Component\Form\Extension\Core\Type\TextType; | |
8 | use Symfony\Component\Form\FormBuilderInterface; | |
9 | use Symfony\Component\OptionsResolver\OptionsResolver; | |
10 | ||
11 | class EditEntryType extends AbstractType | |
12 | { | |
13 | public function buildForm(FormBuilderInterface $builder, array $options) | |
14 | { | |
15 | $builder | |
16 | ->add('title', TextType::class, [ | |
17 | 'required' => true, | |
18 | 'label' => 'entry.edit.title_label', | |
19 | ]) | |
20 | ->add('url', TextType::class, [ | |
21 | 'disabled' => true, | |
22 | 'required' => false, | |
23 | 'label' => 'entry.edit.url_label', | |
24 | ]) | |
25 | ->add('save', SubmitType::class, [ | |
26 | 'label' => 'entry.edit.save_label', | |
27 | ]) | |
28 | ; | |
29 | } | |
30 | ||
31 | public function configureOptions(OptionsResolver $resolver) | |
32 | { | |
33 | $resolver->setDefaults([ | |
34 | 'data_class' => 'Wallabag\CoreBundle\Entity\Entry', | |
35 | ]); | |
36 | } | |
37 | ||
38 | public function getBlockPrefix() | |
39 | { | |
40 | return 'entry'; | |
41 | } | |
42 | } |