namespace Wallabag\CoreBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
+use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
+use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
- ->add('theme', 'choice', array(
+ ->add('theme', ChoiceType::class, array(
'choices' => array_flip($this->themes),
'choices_as_values' => true,
+ 'label' => 'config.form_settings.theme_label',
))
- ->add('items_per_page')
- ->add('language', 'choice', array(
- 'choices' => $this->languages,
+ ->add('items_per_page', null, array(
+ 'label' => 'config.form_settings.items_per_page_label',
+ ))
+ ->add('reading_speed', ChoiceType::class, array(
+ 'label' => 'config.form_settings.reading_speed',
+ 'choices' => array(
+ 'I read ~100 words per minute' => '0.5',
+ 'I read ~200 words per minute' => '1',
+ 'I read ~300 words per minute' => '1.5',
+ 'I read ~400 words per minute' => '2',
+ ),
+ ))
+ ->add('language', ChoiceType::class, array(
+ 'choices' => array_flip($this->languages),
+ 'choices_as_values' => true,
+ 'label' => 'config.form_settings.language_label',
+ ))
+ ->add('save', SubmitType::class, array(
+ 'label' => 'config.form.save',
))
- ->add('save', 'submit')
;
}
));
}
- public function getName()
+ public function getBlockPrefix()
{
return 'config';
}