Skip to content

[Form] Incorrect description for choice_attr option of ChoiceType field #6443

@mvar

Description

@mvar

Current choice_attr description:

Use this to add additional HTML attributes to each choice. This can be an array of attributes (if they are the same for each choice), a callable or a property path (just like choice_label).

Actually it's not possible to set attributes for all choices at once. You need to redefine attributes for each choice separately:

'choice_attr' => [
    'Choice A' => ['class' => 'foo'],
    'Choice B' => ['class' => 'foo'],
    ...
    'Choice Z' => ['class' => 'foo'],
],

Please correct me if I'm wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy