2 namespace Wallabag\CoreBundle\Form\Type
;
4 use Symfony\Component\Form\AbstractType
;
5 use Symfony\Component\Form\FormBuilderInterface
;
6 use Symfony\Component\OptionsResolver\OptionsResolverInterface
;
8 class ConfigType
extends AbstractType
10 private $themes = array();
13 * @param array $themes Themes come from the LiipThemeBundle (liip_theme.themes)
15 public function __construct($themes)
17 $this->themes
= array_combine(
19 array_map(function ($s) { return ucwords(strtolower(str_replace('-', ' ', $s
))); }, $themes)
23 public function buildForm(FormBuilderInterface
$builder, array $options)
26 ->add('theme', 'choice', array('choices' => $this->themes
))
27 ->add('items_per_page')
29 ->add('save', 'submit')
33 public function setDefaultOptions(OptionsResolverInterface
$resolver)
35 $resolver->setDefaults(array(
36 'data_class' => 'Wallabag\CoreBundle\Entity\Config',
40 public function getName()