mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
flip value for 'other'
This commit is contained in:
parent
ed526fa8ea
commit
654f7b4d26
@ -28,8 +28,10 @@ class ChoiceWithOtherType extends AbstractType
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
||||
//$otherValueLabel = $options['other_value_label'];
|
||||
//add an 'other' entry in choices array
|
||||
$options['choices']['_other'] = $this->otherValueLabel;
|
||||
$options['choices'][$this->otherValueLabel] = '_other';
|
||||
//ChoiceWithOther must always be expanded
|
||||
$options['expanded'] = true;
|
||||
// adding a default value for choice
|
||||
@ -50,6 +52,7 @@ class ChoiceWithOtherType extends AbstractType
|
||||
$resolver
|
||||
->setRequired(array('choices'))
|
||||
->setAllowedTypes('choices', array('array'))
|
||||
//->setDefault('other_value_label', null)
|
||||
->setDefaults(array(
|
||||
'multiple' => false,
|
||||
))
|
||||
|
Loading…
x
Reference in New Issue
Block a user