3 namespace Wallabag\CoreBundle\Form\Type
;
5 use Symfony\Component\Form\AbstractType
;
6 use Symfony\Component\Form\FormBuilderInterface
;
7 use Symfony\Component\OptionsResolver\OptionsResolverInterface
;
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('choices' => $this->themes
))
28 ->add('items_per_page')
30 ->add('save', 'submit')
34 public function setDefaultOptions(OptionsResolverInterface
$resolver)
36 $resolver->setDefaults(array(
37 'data_class' => 'Wallabag\CoreBundle\Entity\Config',
41 public function getName()