fix deprecations: use choices_as_values=true and flip content of the choice options

This commit is contained in:
nobohan
2018-04-04 17:50:23 +02:00
parent 9951a5d765
commit 23dd4ec48b
6 changed files with 23 additions and 15 deletions

View File

@@ -104,10 +104,11 @@ class CustomFieldTitle extends AbstractCustomField
return $builder->add(self::TYPE, ChoiceType::class,
array(
'choices' => array(
self::TYPE_TITLE => 'Main title',
self::TYPE_SUBTITLE => 'Subtitle'
'Main title' => self::TYPE_TITLE,
'Subtitle' => self::TYPE_SUBTITLE
),
'label' => 'Title level'
'label' => 'Title level',
'choices_as_values' => true
)
);
}