forked from wallabag/wallabag
Implement simple config
This commit is contained in:
41
src/Wallabag/CoreBundle/Form/Type/ConfigType.php
Normal file
41
src/Wallabag/CoreBundle/Form/Type/ConfigType.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
namespace Wallabag\CoreBundle\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||
|
||||
class ConfigType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('theme', 'choice', array(
|
||||
'choices' => array(
|
||||
'baggy' => 'Baggy',
|
||||
'courgette' => 'Courgette',
|
||||
'dark' => 'Dark',
|
||||
'default' => 'Default',
|
||||
'dmagenta' => 'Dmagenta',
|
||||
'solarized' => 'Solarized',
|
||||
'solarized_dark' => 'Solarized Dark',
|
||||
),
|
||||
))
|
||||
->add('items_per_page')
|
||||
->add('language')
|
||||
->add('save', 'submit')
|
||||
;
|
||||
}
|
||||
|
||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'Wallabag\CoreBundle\Entity\Config',
|
||||
));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'config';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user