diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Form')
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/ConfigType.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php new file mode 100644 index 00000000..74e2a6f1 --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php | |||
@@ -0,0 +1,41 @@ | |||
1 | <?php | ||
2 | namespace Wallabag\CoreBundle\Form\Type; | ||
3 | |||
4 | use Symfony\Component\Form\AbstractType; | ||
5 | use Symfony\Component\Form\FormBuilderInterface; | ||
6 | use Symfony\Component\OptionsResolver\OptionsResolverInterface; | ||
7 | |||
8 | class ConfigType extends AbstractType | ||
9 | { | ||
10 | public function buildForm(FormBuilderInterface $builder, array $options) | ||
11 | { | ||
12 | $builder | ||
13 | ->add('theme', 'choice', array( | ||
14 | 'choices' => array( | ||
15 | 'baggy' => 'Baggy', | ||
16 | 'courgette' => 'Courgette', | ||
17 | 'dark' => 'Dark', | ||
18 | 'default' => 'Default', | ||
19 | 'dmagenta' => 'Dmagenta', | ||
20 | 'solarized' => 'Solarized', | ||
21 | 'solarized_dark' => 'Solarized Dark', | ||
22 | ), | ||
23 | )) | ||
24 | ->add('items_per_page') | ||
25 | ->add('language') | ||
26 | ->add('save', 'submit') | ||
27 | ; | ||
28 | } | ||
29 | |||
30 | public function setDefaultOptions(OptionsResolverInterface $resolver) | ||
31 | { | ||
32 | $resolver->setDefaults(array( | ||
33 | 'data_class' => 'Wallabag\CoreBundle\Entity\Config', | ||
34 | )); | ||
35 | } | ||
36 | |||
37 | public function getName() | ||
38 | { | ||
39 | return 'config'; | ||
40 | } | ||
41 | } | ||