mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +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)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//$otherValueLabel = $options['other_value_label'];
|
||||||
//add an 'other' entry in choices array
|
//add an 'other' entry in choices array
|
||||||
$options['choices']['_other'] = $this->otherValueLabel;
|
$options['choices'][$this->otherValueLabel] = '_other';
|
||||||
//ChoiceWithOther must always be expanded
|
//ChoiceWithOther must always be expanded
|
||||||
$options['expanded'] = true;
|
$options['expanded'] = true;
|
||||||
// adding a default value for choice
|
// adding a default value for choice
|
||||||
@ -50,6 +52,7 @@ class ChoiceWithOtherType extends AbstractType
|
|||||||
$resolver
|
$resolver
|
||||||
->setRequired(array('choices'))
|
->setRequired(array('choices'))
|
||||||
->setAllowedTypes('choices', array('array'))
|
->setAllowedTypes('choices', array('array'))
|
||||||
|
//->setDefault('other_value_label', null)
|
||||||
->setDefaults(array(
|
->setDefaults(array(
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
))
|
))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user