Skip to content

[Form] Dot in choice field type values #3021

Closed
@igorlesnenko

Description

@igorlesnenko

The code below causes error:

Could not parse property path "notwork..c". Unexpected token "." at position 7
500 Internal Server Error - InvalidPropertyPathException

I combined several examples in one, to show what will work:

   $builder = $this->createFormBuilder();
   $builder->add('availability', 'choice', array(
            'choices'   => array(
                'notwork..c'   => 'Next month',
                'not work...'   => 'Morning',
                'not work.,.' => "Afternoon",
                'not work. '   => 'Evening',
                'work.c'   => 'Next year',                
            ),
            'multiple'  => true,            
            'expanded' => true,
        ));

In template: {{ form_widget(form) }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions