Skip to content

Choice reverse key / value #2

Description

@Kaaly

I create a form like this :

$categories = ['Gestion', 'other' => 'Autre catégorie'];
$formProject = new Form('project_category');
$formProject->add(new Choice('category', ['label' => 'Catégorie', 'choices' => $categories]));

The result is :

<select id="project_category_category" name="project_category[category]">
                     <option value="Gestion">0</option>
                      <option value="Autre catégorie">other</option>
</select>

but it shoud be this :

<select id="project_category_category" name="project_category[category]">
                     <option>Gestion</option>
                      <option value="other">Autre catégorie</option>
</select>

Can you fix it please ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions