3 namespace Wallabag\CoreBundle\Form\Type
;
5 use Symfony\Component\Form\AbstractType
;
6 use Symfony\Component\Form\FormBuilderInterface
;
7 use Symfony\Component\OptionsResolver\OptionsResolver
;
9 class ConfigType
extends AbstractType
11 private $themes = array();
14 * @param array $themes Themes come from the LiipThemeBundle (liip_theme.themes)
16 public function __construct($themes)
18 $this->themes
= array_combine(
20 array_map(function ($s) { return ucwords(strtolower(str_replace('-', ' ', $s
))); }, $themes)
24 public function buildForm(FormBuilderInterface
$builder, array $options)
27 ->add('theme', 'choice', array(
28 'choices' => array_flip($this->themes
),
29 'choices_as_values' => true,
31 ->add('items_per_page')
33 ->add('save', 'submit')
37 public function configureOptions(OptionsResolver
$resolver)
39 $resolver->setDefaults(array(
40 'data_class' => 'Wallabag\CoreBundle\Entity\Config',
44 public function getName()