mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-11 01:04:57 +00:00
Compare commits
2 Commits
fix_mado_t
...
dune-risky
Author | SHA1 | Date | |
---|---|---|---|
915a2e7284 | |||
cb99074d1f |
@@ -22,13 +22,12 @@ class ChoiceWithOtherType extends AbstractType
|
|||||||
*/
|
*/
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
|
|
||||||
//add an 'other' entry in choices array
|
//add an 'other' entry in choices array
|
||||||
$options['choices'][$this->otherValueLabel] = '_other';
|
$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
|
||||||
$options['empty_data'] = null;
|
$options['empty_data'] = $options['multiple'] ? [] : null;
|
||||||
|
|
||||||
$builder
|
$builder
|
||||||
->add('_other', TextType::class, array('required' => false))
|
->add('_other', TextType::class, array('required' => false))
|
||||||
|
Reference in New Issue
Block a user